From 8ed404a58b030b81b78cc9304f388279c81f4705 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Fri, 9 Apr 2021 11:12:19 -0700 Subject: [PATCH] feat: add v3 client (#423) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add v3 client * 🦉 Updates from OwlBot * fix declared dependencies Co-authored-by: Owl Bot --- java-resourcemanager/.github/.OwlBot.yaml | 2 +- .../google-cloud-resourcemanager-bom/pom.xml | 10 + .../google-cloud-resourcemanager/pom.xml | 48 + .../resourcemanager/v3/FoldersClient.java | 1967 +++++++++++ .../resourcemanager/v3/FoldersSettings.java | 360 ++ .../v3/OrganizationsClient.java | 861 +++++ .../v3/OrganizationsSettings.java | 239 ++ .../resourcemanager/v3/ProjectsClient.java | 2062 +++++++++++ .../resourcemanager/v3/ProjectsSettings.java | 361 ++ .../resourcemanager/v3/TagBindingsClient.java | 656 ++++ .../v3/TagBindingsSettings.java | 238 ++ .../resourcemanager/v3/TagKeysClient.java | 1175 +++++++ .../resourcemanager/v3/TagKeysSettings.java | 302 ++ .../resourcemanager/v3/TagValuesClient.java | 1186 +++++++ .../resourcemanager/v3/TagValuesSettings.java | 302 ++ .../resourcemanager/v3/gapic_metadata.json | 201 ++ .../resourcemanager/v3/package-info.java | 105 + .../resourcemanager/v3/stub/FoldersStub.java | 144 + .../v3/stub/FoldersStubSettings.java | 886 +++++ .../v3/stub/GrpcFoldersCallableFactory.java | 113 + .../v3/stub/GrpcFoldersStub.java | 560 +++ .../GrpcOrganizationsCallableFactory.java | 113 + .../v3/stub/GrpcOrganizationsStub.java | 309 ++ .../v3/stub/GrpcProjectsCallableFactory.java | 113 + .../v3/stub/GrpcProjectsStub.java | 564 +++ .../stub/GrpcTagBindingsCallableFactory.java | 113 + .../v3/stub/GrpcTagBindingsStub.java | 257 ++ .../v3/stub/GrpcTagKeysCallableFactory.java | 113 + .../v3/stub/GrpcTagKeysStub.java | 428 +++ .../v3/stub/GrpcTagValuesCallableFactory.java | 113 + .../v3/stub/GrpcTagValuesStub.java | 435 +++ .../v3/stub/OrganizationsStub.java | 72 + .../v3/stub/OrganizationsStubSettings.java | 469 +++ .../resourcemanager/v3/stub/ProjectsStub.java | 144 + .../v3/stub/ProjectsStubSettings.java | 892 +++++ .../v3/stub/TagBindingsStub.java | 78 + .../v3/stub/TagBindingsStubSettings.java | 503 +++ .../resourcemanager/v3/stub/TagKeysStub.java | 110 + .../v3/stub/TagKeysStubSettings.java | 662 ++++ .../v3/stub/TagValuesStub.java | 111 + .../v3/stub/TagValuesStubSettings.java | 669 ++++ .../resourcemanager/v3/FoldersClientTest.java | 1095 ++++++ .../cloud/resourcemanager/v3/MockFolders.java | 59 + .../resourcemanager/v3/MockFoldersImpl.java | 294 ++ .../resourcemanager/v3/MockOrganizations.java | 59 + .../v3/MockOrganizationsImpl.java | 170 + .../resourcemanager/v3/MockProjects.java | 59 + .../resourcemanager/v3/MockProjectsImpl.java | 294 ++ .../resourcemanager/v3/MockTagBindings.java | 59 + .../v3/MockTagBindingsImpl.java | 124 + .../cloud/resourcemanager/v3/MockTagKeys.java | 59 + .../resourcemanager/v3/MockTagKeysImpl.java | 232 ++ .../resourcemanager/v3/MockTagValues.java | 59 + .../resourcemanager/v3/MockTagValuesImpl.java | 232 ++ .../v3/OrganizationsClientTest.java | 458 +++ .../v3/ProjectsClientTest.java | 1120 ++++++ .../v3/TagBindingsClientTest.java | 306 ++ .../resourcemanager/v3/TagKeysClientTest.java | 732 ++++ .../v3/TagValuesClientTest.java | 732 ++++ .../pom.xml | 73 + .../cloud/resourcemanager/v3/FoldersGrpc.java | 1850 ++++++++++ .../resourcemanager/v3/OrganizationsGrpc.java | 882 +++++ .../resourcemanager/v3/ProjectsGrpc.java | 1871 ++++++++++ .../resourcemanager/v3/TagBindingsGrpc.java | 613 ++++ .../cloud/resourcemanager/v3/TagKeysGrpc.java | 1201 +++++++ .../resourcemanager/v3/TagValuesGrpc.java | 1220 +++++++ java-resourcemanager/pom.xml | 12 + .../clirr-ignored-differences.xml | 19 + .../pom.xml | 46 + .../v3/CreateFolderMetadata.java | 823 +++++ .../v3/CreateFolderMetadataOrBuilder.java | 77 + .../v3/CreateFolderRequest.java | 770 +++++ .../v3/CreateFolderRequestOrBuilder.java | 69 + .../v3/CreateProjectMetadata.java | 921 +++++ .../v3/CreateProjectMetadataOrBuilder.java | 88 + .../v3/CreateProjectRequest.java | 834 +++++ .../v3/CreateProjectRequestOrBuilder.java | 84 + .../v3/CreateTagBindingMetadata.java | 460 +++ .../v3/CreateTagBindingMetadataOrBuilder.java | 24 + .../v3/CreateTagBindingRequest.java | 853 +++++ .../v3/CreateTagBindingRequestOrBuilder.java | 80 + .../v3/CreateTagKeyMetadata.java | 457 +++ .../v3/CreateTagKeyMetadataOrBuilder.java | 24 + .../v3/CreateTagKeyRequest.java | 864 +++++ .../v3/CreateTagKeyRequestOrBuilder.java | 83 + .../v3/CreateTagValueMetadata.java | 457 +++ .../v3/CreateTagValueMetadataOrBuilder.java | 24 + .../v3/CreateTagValueRequest.java | 865 +++++ .../v3/CreateTagValueRequestOrBuilder.java | 83 + .../v3/DeleteFolderMetadata.java | 459 +++ .../v3/DeleteFolderMetadataOrBuilder.java | 24 + .../v3/DeleteFolderRequest.java | 658 ++++ .../v3/DeleteFolderRequestOrBuilder.java | 56 + .../v3/DeleteOrganizationMetadata.java | 465 +++ .../DeleteOrganizationMetadataOrBuilder.java | 24 + .../v3/DeleteProjectMetadata.java | 459 +++ .../v3/DeleteProjectMetadataOrBuilder.java | 24 + .../v3/DeleteProjectRequest.java | 653 ++++ .../v3/DeleteProjectRequestOrBuilder.java | 54 + .../v3/DeleteTagBindingMetadata.java | 460 +++ .../v3/DeleteTagBindingMetadataOrBuilder.java | 24 + .../v3/DeleteTagBindingRequest.java | 665 ++++ .../v3/DeleteTagBindingRequestOrBuilder.java | 58 + .../v3/DeleteTagKeyMetadata.java | 457 +++ .../v3/DeleteTagKeyMetadataOrBuilder.java | 24 + .../v3/DeleteTagKeyRequest.java | 945 +++++ .../v3/DeleteTagKeyRequestOrBuilder.java | 99 + .../v3/DeleteTagValueMetadata.java | 457 +++ .../v3/DeleteTagValueMetadataOrBuilder.java | 24 + .../v3/DeleteTagValueRequest.java | 931 +++++ .../v3/DeleteTagValueRequestOrBuilder.java | 95 + .../cloud/resourcemanager/v3/Folder.java | 2473 +++++++++++++ .../cloud/resourcemanager/v3/FolderName.java | 168 + .../resourcemanager/v3/FolderOrBuilder.java | 296 ++ .../resourcemanager/v3/FoldersProto.java | 380 ++ .../resourcemanager/v3/GetFolderRequest.java | 657 ++++ .../v3/GetFolderRequestOrBuilder.java | 56 + .../v3/GetOrganizationRequest.java | 667 ++++ .../v3/GetOrganizationRequestOrBuilder.java | 58 + .../resourcemanager/v3/GetProjectRequest.java | 655 ++++ .../v3/GetProjectRequestOrBuilder.java | 54 + .../resourcemanager/v3/GetTagKeyRequest.java | 657 ++++ .../v3/GetTagKeyRequestOrBuilder.java | 56 + .../v3/GetTagValueRequest.java | 651 ++++ .../v3/GetTagValueRequestOrBuilder.java | 54 + .../v3/ListFoldersRequest.java | 1057 ++++++ .../v3/ListFoldersRequestOrBuilder.java | 118 + .../v3/ListFoldersResponse.java | 1159 +++++++ .../v3/ListFoldersResponseOrBuilder.java | 109 + .../v3/ListProjectsRequest.java | 1054 ++++++ .../v3/ListProjectsRequestOrBuilder.java | 116 + .../v3/ListProjectsResponse.java | 1193 +++++++ .../v3/ListProjectsResponseOrBuilder.java | 116 + .../v3/ListTagBindingsRequest.java | 949 +++++ .../v3/ListTagBindingsRequestOrBuilder.java | 100 + .../v3/ListTagBindingsResponse.java | 1206 +++++++ .../v3/ListTagBindingsResponseOrBuilder.java | 121 + .../v3/ListTagKeysRequest.java | 942 +++++ .../v3/ListTagKeysRequestOrBuilder.java | 98 + .../v3/ListTagKeysResponse.java | 1136 ++++++ .../v3/ListTagKeysResponseOrBuilder.java | 104 + .../v3/ListTagValuesRequest.java | 942 +++++ .../v3/ListTagValuesRequestOrBuilder.java | 98 + .../v3/ListTagValuesResponse.java | 1169 +++++++ .../v3/ListTagValuesResponseOrBuilder.java | 111 + .../v3/MoveFolderMetadata.java | 995 ++++++ .../v3/MoveFolderMetadataOrBuilder.java | 100 + .../resourcemanager/v3/MoveFolderRequest.java | 865 +++++ .../v3/MoveFolderRequestOrBuilder.java | 89 + .../v3/MoveProjectMetadata.java | 459 +++ .../v3/MoveProjectMetadataOrBuilder.java | 24 + .../v3/MoveProjectRequest.java | 848 +++++ .../v3/MoveProjectRequestOrBuilder.java | 83 + .../resourcemanager/v3/Organization.java | 2560 ++++++++++++++ .../resourcemanager/v3/OrganizationName.java | 168 + .../v3/OrganizationOrBuilder.java | 296 ++ .../v3/OrganizationsProto.java | 213 ++ .../cloud/resourcemanager/v3/Project.java | 3071 +++++++++++++++++ .../cloud/resourcemanager/v3/ProjectName.java | 168 + .../resourcemanager/v3/ProjectOrBuilder.java | 413 +++ .../resourcemanager/v3/ProjectsProto.java | 397 +++ .../v3/SearchFoldersRequest.java | 1078 ++++++ .../v3/SearchFoldersRequestOrBuilder.java | 137 + .../v3/SearchFoldersResponse.java | 1159 +++++++ .../v3/SearchFoldersResponseOrBuilder.java | 109 + .../v3/SearchOrganizationsRequest.java | 1007 ++++++ .../SearchOrganizationsRequestOrBuilder.java | 115 + .../v3/SearchOrganizationsResponse.java | 1201 +++++++ .../SearchOrganizationsResponseOrBuilder.java | 115 + .../v3/SearchProjectsRequest.java | 1135 ++++++ .../v3/SearchProjectsRequestOrBuilder.java | 152 + .../v3/SearchProjectsResponse.java | 1212 +++++++ .../v3/SearchProjectsResponseOrBuilder.java | 121 + .../cloud/resourcemanager/v3/TagBinding.java | 1026 ++++++ .../resourcemanager/v3/TagBindingName.java | 168 + .../v3/TagBindingOrBuilder.java | 108 + .../resourcemanager/v3/TagBindingsProto.java | 197 ++ .../cloud/resourcemanager/v3/TagKey.java | 2206 ++++++++++++ .../cloud/resourcemanager/v3/TagKeyName.java | 168 + .../resourcemanager/v3/TagKeyOrBuilder.java | 277 ++ .../resourcemanager/v3/TagKeysProto.java | 278 ++ .../cloud/resourcemanager/v3/TagValue.java | 2194 ++++++++++++ .../resourcemanager/v3/TagValueName.java | 168 + .../resourcemanager/v3/TagValueOrBuilder.java | 273 ++ .../resourcemanager/v3/TagValuesProto.java | 281 ++ .../v3/UndeleteFolderMetadata.java | 459 +++ .../v3/UndeleteFolderMetadataOrBuilder.java | 24 + .../v3/UndeleteFolderRequest.java | 658 ++++ .../v3/UndeleteFolderRequestOrBuilder.java | 56 + .../v3/UndeleteOrganizationMetadata.java | 466 +++ ...UndeleteOrganizationMetadataOrBuilder.java | 24 + .../v3/UndeleteProjectMetadata.java | 459 +++ .../v3/UndeleteProjectMetadataOrBuilder.java | 24 + .../v3/UndeleteProjectRequest.java | 662 ++++ .../v3/UndeleteProjectRequestOrBuilder.java | 56 + .../v3/UpdateFolderMetadata.java | 459 +++ .../v3/UpdateFolderMetadataOrBuilder.java | 24 + .../v3/UpdateFolderRequest.java | 1078 ++++++ .../v3/UpdateFolderRequestOrBuilder.java | 110 + .../v3/UpdateProjectMetadata.java | 459 +++ .../v3/UpdateProjectMetadataOrBuilder.java | 24 + .../v3/UpdateProjectRequest.java | 1052 ++++++ .../v3/UpdateProjectRequestOrBuilder.java | 104 + .../v3/UpdateTagKeyMetadata.java | 457 +++ .../v3/UpdateTagKeyMetadataOrBuilder.java | 24 + .../v3/UpdateTagKeyRequest.java | 1184 +++++++ .../v3/UpdateTagKeyRequestOrBuilder.java | 130 + .../v3/UpdateTagValueMetadata.java | 457 +++ .../v3/UpdateTagValueMetadataOrBuilder.java | 24 + .../v3/UpdateTagValueRequest.java | 1173 +++++++ .../v3/UpdateTagValueRequestOrBuilder.java | 127 + .../cloud/resourcemanager/v3/folders.proto | 533 +++ .../resourcemanager/v3/organizations.proto | 235 ++ .../cloud/resourcemanager/v3/projects.proto | 635 ++++ .../resourcemanager/v3/tag_bindings.proto | 176 + .../cloud/resourcemanager/v3/tag_keys.proto | 299 ++ .../cloud/resourcemanager/v3/tag_values.proto | 295 ++ java-resourcemanager/versions.txt | 2 + 218 files changed, 103393 insertions(+), 1 deletion(-) create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/FoldersClient.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/FoldersSettings.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationsClient.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationsSettings.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/ProjectsClient.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/ProjectsSettings.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagBindingsClient.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagBindingsSettings.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagKeysClient.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagKeysSettings.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagValuesClient.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagValuesSettings.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/gapic_metadata.json create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/package-info.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/FoldersStub.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/FoldersStubSettings.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcFoldersCallableFactory.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcFoldersStub.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcOrganizationsCallableFactory.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcOrganizationsStub.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcProjectsCallableFactory.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcProjectsStub.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcTagBindingsCallableFactory.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcTagBindingsStub.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcTagKeysCallableFactory.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcTagKeysStub.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcTagValuesCallableFactory.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcTagValuesStub.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/OrganizationsStub.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/OrganizationsStubSettings.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/ProjectsStub.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/ProjectsStubSettings.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/TagBindingsStub.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/TagBindingsStubSettings.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/TagKeysStub.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/TagKeysStubSettings.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/TagValuesStub.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/TagValuesStubSettings.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/FoldersClientTest.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockFolders.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockFoldersImpl.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockOrganizations.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockOrganizationsImpl.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockProjects.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockProjectsImpl.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockTagBindings.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockTagBindingsImpl.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockTagKeys.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockTagKeysImpl.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockTagValues.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockTagValuesImpl.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/OrganizationsClientTest.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/ProjectsClientTest.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/TagBindingsClientTest.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/TagKeysClientTest.java create mode 100644 java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/TagValuesClientTest.java create mode 100644 java-resourcemanager/grpc-google-cloud-resourcemanager-v3/pom.xml create mode 100644 java-resourcemanager/grpc-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/FoldersGrpc.java create mode 100644 java-resourcemanager/grpc-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationsGrpc.java create mode 100644 java-resourcemanager/grpc-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ProjectsGrpc.java create mode 100644 java-resourcemanager/grpc-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagBindingsGrpc.java create mode 100644 java-resourcemanager/grpc-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagKeysGrpc.java create mode 100644 java-resourcemanager/grpc-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagValuesGrpc.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/clirr-ignored-differences.xml create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/pom.xml create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateFolderMetadata.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateFolderMetadataOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateFolderRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateFolderRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateProjectMetadata.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateProjectMetadataOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateProjectRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateProjectRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagBindingMetadata.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagBindingMetadataOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagBindingRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagBindingRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagKeyMetadata.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagKeyMetadataOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagKeyRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagKeyRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagValueMetadata.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagValueMetadataOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagValueRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagValueRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteFolderMetadata.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteFolderMetadataOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteFolderRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteFolderRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteOrganizationMetadata.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteOrganizationMetadataOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteProjectMetadata.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteProjectMetadataOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteProjectRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteProjectRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagBindingMetadata.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagBindingMetadataOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagBindingRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagBindingRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagKeyMetadata.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagKeyMetadataOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagKeyRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagKeyRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagValueMetadata.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagValueMetadataOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagValueRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagValueRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/Folder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/FolderName.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/FolderOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/FoldersProto.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetFolderRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetFolderRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetOrganizationRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetOrganizationRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetProjectRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetProjectRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetTagKeyRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetTagKeyRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetTagValueRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetTagValueRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListFoldersRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListFoldersRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListFoldersResponse.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListFoldersResponseOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListProjectsRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListProjectsRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListProjectsResponse.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListProjectsResponseOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagBindingsRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagBindingsRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagBindingsResponse.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagBindingsResponseOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagKeysRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagKeysRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagKeysResponse.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagKeysResponseOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagValuesRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagValuesRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagValuesResponse.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagValuesResponseOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveFolderMetadata.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveFolderMetadataOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveFolderRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveFolderRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveProjectMetadata.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveProjectMetadataOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveProjectRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveProjectRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/Organization.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationName.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationsProto.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/Project.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ProjectName.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ProjectOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ProjectsProto.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchFoldersRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchFoldersRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchFoldersResponse.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchFoldersResponseOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchOrganizationsRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchOrganizationsRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchOrganizationsResponse.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchOrganizationsResponseOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchProjectsRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchProjectsRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchProjectsResponse.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchProjectsResponseOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagBinding.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagBindingName.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagBindingOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagBindingsProto.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagKey.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagKeyName.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagKeyOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagKeysProto.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagValue.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagValueName.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagValueOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagValuesProto.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteFolderMetadata.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteFolderMetadataOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteFolderRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteFolderRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteOrganizationMetadata.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteOrganizationMetadataOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteProjectMetadata.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteProjectMetadataOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteProjectRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteProjectRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateFolderMetadata.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateFolderMetadataOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateFolderRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateFolderRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateProjectMetadata.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateProjectMetadataOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateProjectRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateProjectRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagKeyMetadata.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagKeyMetadataOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagKeyRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagKeyRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagValueMetadata.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagValueMetadataOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagValueRequest.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagValueRequestOrBuilder.java create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/proto/google/cloud/resourcemanager/v3/folders.proto create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/proto/google/cloud/resourcemanager/v3/organizations.proto create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/proto/google/cloud/resourcemanager/v3/projects.proto create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/proto/google/cloud/resourcemanager/v3/tag_bindings.proto create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/proto/google/cloud/resourcemanager/v3/tag_keys.proto create mode 100644 java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/proto/google/cloud/resourcemanager/v3/tag_values.proto diff --git a/java-resourcemanager/.github/.OwlBot.yaml b/java-resourcemanager/.github/.OwlBot.yaml index c2e058e898b1..42cda440b98d 100644 --- a/java-resourcemanager/.github/.OwlBot.yaml +++ b/java-resourcemanager/.github/.OwlBot.yaml @@ -18,7 +18,7 @@ docker: deep-remove-regex: - "/grpc-google-.*/src" - "/proto-google-.*/src" -- "/google-.*/src" +- "/google-.*/src/main/java/com/google/cloud/resourcemanager/(v.*)" deep-copy-regex: - source: "/google/cloud/resourcemanager/(v.*)/.*-java/proto-google-.*/src" diff --git a/java-resourcemanager/google-cloud-resourcemanager-bom/pom.xml b/java-resourcemanager/google-cloud-resourcemanager-bom/pom.xml index dcd8e083f25c..839b54919dec 100644 --- a/java-resourcemanager/google-cloud-resourcemanager-bom/pom.xml +++ b/java-resourcemanager/google-cloud-resourcemanager-bom/pom.xml @@ -58,6 +58,16 @@ google-cloud-resourcemanager 0.118.13-alpha-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-resourcemanager-v3 + 0.118.13-alpha-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-resourcemanager-v3 + 0.118.13-alpha-SNAPSHOT + diff --git a/java-resourcemanager/google-cloud-resourcemanager/pom.xml b/java-resourcemanager/google-cloud-resourcemanager/pom.xml index 7d29ed6b99d0..2691c45db041 100644 --- a/java-resourcemanager/google-cloud-resourcemanager/pom.xml +++ b/java-resourcemanager/google-cloud-resourcemanager/pom.xml @@ -82,6 +82,15 @@ + + com.google.api.grpc + proto-google-cloud-resourcemanager-v3 + + + com.google.api.grpc + grpc-google-cloud-resourcemanager-v3 + test + com.google.api api-common @@ -119,6 +128,34 @@ com.google.guava guava + + com.google.api.grpc + proto-google-iam-v1 + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api.grpc + proto-google-common-protos + + + com.google.protobuf + protobuf-java + + + com.google.api + gax-grpc + com.google.api gax @@ -160,6 +197,17 @@ test test-jar + + com.google.api.grpc + grpc-google-cloud-resourcemanager-v3 + test + + + com.google.api + gax-grpc + testlib + test + diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/FoldersClient.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/FoldersClient.java new file mode 100644 index 000000000000..b13644d23a56 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/FoldersClient.java @@ -0,0 +1,1967 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.resourcenames.ResourceName; +import com.google.cloud.resourcemanager.v3.stub.FoldersStub; +import com.google.cloud.resourcemanager.v3.stub.FoldersStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Manages Cloud Platform folder resources. Folders can be used to organize the + * resources under an organization and to control the policies applied to groups of resources. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * try (FoldersClient foldersClient = FoldersClient.create()) {
+ *   FolderName name = FolderName.of("[FOLDER]");
+ *   Folder response = foldersClient.getFolder(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the FoldersClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

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 parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of FoldersSettings to create(). + * For example: + * + *

To customize credentials: + * + *

{@code
+ * FoldersSettings foldersSettings =
+ *     FoldersSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * FoldersClient foldersClient = FoldersClient.create(foldersSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * FoldersSettings foldersSettings = FoldersSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * FoldersClient foldersClient = FoldersClient.create(foldersSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class FoldersClient implements BackgroundResource { + private final FoldersSettings settings; + private final FoldersStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of FoldersClient with default settings. */ + public static final FoldersClient create() throws IOException { + return create(FoldersSettings.newBuilder().build()); + } + + /** + * Constructs an instance of FoldersClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final FoldersClient create(FoldersSettings settings) throws IOException { + return new FoldersClient(settings); + } + + /** + * Constructs an instance of FoldersClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(FoldersSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final FoldersClient create(FoldersStub stub) { + return new FoldersClient(stub); + } + + /** + * Constructs an instance of FoldersClient, using the given settings. This is protected so that it + * is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected FoldersClient(FoldersSettings settings) throws IOException { + this.settings = settings; + this.stub = ((FoldersStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected FoldersClient(FoldersStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final FoldersSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public FoldersStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   FolderName name = FolderName.of("[FOLDER]");
+   *   Folder response = foldersClient.getFolder(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the folder to retrieve. Must be of the form + * `folders/{folder_id}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Folder getFolder(FolderName name) { + GetFolderRequest request = + GetFolderRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getFolder(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   String name = FolderName.of("[FOLDER]").toString();
+   *   Folder response = foldersClient.getFolder(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the folder to retrieve. Must be of the form + * `folders/{folder_id}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Folder getFolder(String name) { + GetFolderRequest request = GetFolderRequest.newBuilder().setName(name).build(); + return getFolder(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   GetFolderRequest request =
+   *       GetFolderRequest.newBuilder().setName(FolderName.of("[FOLDER]").toString()).build();
+   *   Folder response = foldersClient.getFolder(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Folder getFolder(GetFolderRequest request) { + return getFolderCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   GetFolderRequest request =
+   *       GetFolderRequest.newBuilder().setName(FolderName.of("[FOLDER]").toString()).build();
+   *   ApiFuture future = foldersClient.getFolderCallable().futureCall(request);
+   *   // Do something.
+   *   Folder response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getFolderCallable() { + return stub.getFolderCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   ResourceName parent = TagValueName.of("[TAG_VALUE]");
+   *   for (Folder element : foldersClient.listFolders(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name of the organization or folder whose folders are being + * listed. Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. Access to + * this method is controlled by checking the `resourcemanager.folders.list` permission on the + * `parent`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListFoldersPagedResponse listFolders(ResourceName parent) { + ListFoldersRequest request = + ListFoldersRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listFolders(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   String parent = TagValueName.of("[TAG_VALUE]").toString();
+   *   for (Folder element : foldersClient.listFolders(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name of the organization or folder whose folders are being + * listed. Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. Access to + * this method is controlled by checking the `resourcemanager.folders.list` permission on the + * `parent`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListFoldersPagedResponse listFolders(String parent) { + ListFoldersRequest request = ListFoldersRequest.newBuilder().setParent(parent).build(); + return listFolders(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   ListFoldersRequest request =
+   *       ListFoldersRequest.newBuilder()
+   *           .setParent(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setShowDeleted(true)
+   *           .build();
+   *   for (Folder element : foldersClient.listFolders(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListFoldersPagedResponse listFolders(ListFoldersRequest request) { + return listFoldersPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   ListFoldersRequest request =
+   *       ListFoldersRequest.newBuilder()
+   *           .setParent(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setShowDeleted(true)
+   *           .build();
+   *   ApiFuture future = foldersClient.listFoldersPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Folder element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listFoldersPagedCallable() { + return stub.listFoldersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   ListFoldersRequest request =
+   *       ListFoldersRequest.newBuilder()
+   *           .setParent(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setShowDeleted(true)
+   *           .build();
+   *   while (true) {
+   *     ListFoldersResponse response = foldersClient.listFoldersCallable().call(request);
+   *     for (Folder element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listFoldersCallable() { + return stub.listFoldersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   String query = "query107944136";
+   *   for (Folder element : foldersClient.searchFolders(query).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param 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". + *
+ * + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SearchFoldersPagedResponse searchFolders(String query) { + SearchFoldersRequest request = SearchFoldersRequest.newBuilder().setQuery(query).build(); + return searchFolders(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   SearchFoldersRequest request =
+   *       SearchFoldersRequest.newBuilder()
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setQuery("query107944136")
+   *           .build();
+   *   for (Folder element : foldersClient.searchFolders(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SearchFoldersPagedResponse searchFolders(SearchFoldersRequest request) { + return searchFoldersPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   SearchFoldersRequest request =
+   *       SearchFoldersRequest.newBuilder()
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setQuery("query107944136")
+   *           .build();
+   *   ApiFuture future = foldersClient.searchFoldersPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Folder element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + searchFoldersPagedCallable() { + return stub.searchFoldersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   SearchFoldersRequest request =
+   *       SearchFoldersRequest.newBuilder()
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setQuery("query107944136")
+   *           .build();
+   *   while (true) {
+   *     SearchFoldersResponse response = foldersClient.searchFoldersCallable().call(request);
+   *     for (Folder element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable searchFoldersCallable() { + return stub.searchFoldersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   Folder folder = Folder.newBuilder().build();
+   *   Folder response = foldersClient.createFolderAsync(folder).get();
+   * }
+   * }
+ * + * @param folder Required. The folder being created, only the display name and parent will be + * consulted. All other fields will be ignored. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createFolderAsync(Folder folder) { + CreateFolderRequest request = CreateFolderRequest.newBuilder().setFolder(folder).build(); + return createFolderAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   CreateFolderRequest request =
+   *       CreateFolderRequest.newBuilder().setFolder(Folder.newBuilder().build()).build();
+   *   Folder response = foldersClient.createFolderAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createFolderAsync( + CreateFolderRequest request) { + return createFolderOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   CreateFolderRequest request =
+   *       CreateFolderRequest.newBuilder().setFolder(Folder.newBuilder().build()).build();
+   *   OperationFuture future =
+   *       foldersClient.createFolderOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Folder response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createFolderOperationCallable() { + return stub.createFolderOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   CreateFolderRequest request =
+   *       CreateFolderRequest.newBuilder().setFolder(Folder.newBuilder().build()).build();
+   *   ApiFuture future = foldersClient.createFolderCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createFolderCallable() { + return stub.createFolderCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   Folder folder = Folder.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Folder response = foldersClient.updateFolderAsync(folder, updateMask).get();
+   * }
+   * }
+ * + * @param folder Required. The new definition of the Folder. It must include the `name` field, + * which cannot be changed. + * @param updateMask Required. Fields to be updated. Only the `display_name` can be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateFolderAsync( + Folder folder, FieldMask updateMask) { + UpdateFolderRequest request = + UpdateFolderRequest.newBuilder().setFolder(folder).setUpdateMask(updateMask).build(); + return updateFolderAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   UpdateFolderRequest request =
+   *       UpdateFolderRequest.newBuilder()
+   *           .setFolder(Folder.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Folder response = foldersClient.updateFolderAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateFolderAsync( + UpdateFolderRequest request) { + return updateFolderOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   UpdateFolderRequest request =
+   *       UpdateFolderRequest.newBuilder()
+   *           .setFolder(Folder.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       foldersClient.updateFolderOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Folder response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateFolderOperationCallable() { + return stub.updateFolderOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   UpdateFolderRequest request =
+   *       UpdateFolderRequest.newBuilder()
+   *           .setFolder(Folder.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = foldersClient.updateFolderCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateFolderCallable() { + return stub.updateFolderCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   FolderName name = FolderName.of("[FOLDER]");
+   *   ResourceName destinationParent = TagValueName.of("[TAG_VALUE]");
+   *   Folder response = foldersClient.moveFolderAsync(name, destinationParent).get();
+   * }
+   * }
+ * + * @param name Required. The resource name of the Folder to move. Must be of the form + * folders/{folder_id} + * @param 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}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture moveFolderAsync( + FolderName name, ResourceName destinationParent) { + MoveFolderRequest request = + MoveFolderRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setDestinationParent(destinationParent == null ? null : destinationParent.toString()) + .build(); + return moveFolderAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   FolderName name = FolderName.of("[FOLDER]");
+   *   String destinationParent = TagValueName.of("[TAG_VALUE]").toString();
+   *   Folder response = foldersClient.moveFolderAsync(name, destinationParent).get();
+   * }
+   * }
+ * + * @param name Required. The resource name of the Folder to move. Must be of the form + * folders/{folder_id} + * @param 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}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture moveFolderAsync( + FolderName name, String destinationParent) { + MoveFolderRequest request = + MoveFolderRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setDestinationParent(destinationParent) + .build(); + return moveFolderAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   String name = FolderName.of("[FOLDER]").toString();
+   *   ResourceName destinationParent = TagValueName.of("[TAG_VALUE]");
+   *   Folder response = foldersClient.moveFolderAsync(name, destinationParent).get();
+   * }
+   * }
+ * + * @param name Required. The resource name of the Folder to move. Must be of the form + * folders/{folder_id} + * @param 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}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture moveFolderAsync( + String name, ResourceName destinationParent) { + MoveFolderRequest request = + MoveFolderRequest.newBuilder() + .setName(name) + .setDestinationParent(destinationParent == null ? null : destinationParent.toString()) + .build(); + return moveFolderAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   String name = FolderName.of("[FOLDER]").toString();
+   *   String destinationParent = TagValueName.of("[TAG_VALUE]").toString();
+   *   Folder response = foldersClient.moveFolderAsync(name, destinationParent).get();
+   * }
+   * }
+ * + * @param name Required. The resource name of the Folder to move. Must be of the form + * folders/{folder_id} + * @param 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}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture moveFolderAsync( + String name, String destinationParent) { + MoveFolderRequest request = + MoveFolderRequest.newBuilder() + .setName(name) + .setDestinationParent(destinationParent) + .build(); + return moveFolderAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   MoveFolderRequest request =
+   *       MoveFolderRequest.newBuilder()
+   *           .setName(FolderName.of("[FOLDER]").toString())
+   *           .setDestinationParent(TagValueName.of("[TAG_VALUE]").toString())
+   *           .build();
+   *   Folder response = foldersClient.moveFolderAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture moveFolderAsync( + MoveFolderRequest request) { + return moveFolderOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   MoveFolderRequest request =
+   *       MoveFolderRequest.newBuilder()
+   *           .setName(FolderName.of("[FOLDER]").toString())
+   *           .setDestinationParent(TagValueName.of("[TAG_VALUE]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       foldersClient.moveFolderOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Folder response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + moveFolderOperationCallable() { + return stub.moveFolderOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   MoveFolderRequest request =
+   *       MoveFolderRequest.newBuilder()
+   *           .setName(FolderName.of("[FOLDER]").toString())
+   *           .setDestinationParent(TagValueName.of("[TAG_VALUE]").toString())
+   *           .build();
+   *   ApiFuture future = foldersClient.moveFolderCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable moveFolderCallable() { + return stub.moveFolderCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   FolderName name = FolderName.of("[FOLDER]");
+   *   Folder response = foldersClient.deleteFolderAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The resource name of the folder to be deleted. Must be of the form + * `folders/{folder_id}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteFolderAsync(FolderName name) { + DeleteFolderRequest request = + DeleteFolderRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteFolderAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   String name = FolderName.of("[FOLDER]").toString();
+   *   Folder response = foldersClient.deleteFolderAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The resource name of the folder to be deleted. Must be of the form + * `folders/{folder_id}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteFolderAsync(String name) { + DeleteFolderRequest request = DeleteFolderRequest.newBuilder().setName(name).build(); + return deleteFolderAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   DeleteFolderRequest request =
+   *       DeleteFolderRequest.newBuilder().setName(FolderName.of("[FOLDER]").toString()).build();
+   *   Folder response = foldersClient.deleteFolderAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteFolderAsync( + DeleteFolderRequest request) { + return deleteFolderOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   DeleteFolderRequest request =
+   *       DeleteFolderRequest.newBuilder().setName(FolderName.of("[FOLDER]").toString()).build();
+   *   OperationFuture future =
+   *       foldersClient.deleteFolderOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Folder response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteFolderOperationCallable() { + return stub.deleteFolderOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   DeleteFolderRequest request =
+   *       DeleteFolderRequest.newBuilder().setName(FolderName.of("[FOLDER]").toString()).build();
+   *   ApiFuture future = foldersClient.deleteFolderCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteFolderCallable() { + return stub.deleteFolderCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   FolderName name = FolderName.of("[FOLDER]");
+   *   Folder response = foldersClient.undeleteFolderAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The resource name of the folder to undelete. Must be of the form + * `folders/{folder_id}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture undeleteFolderAsync( + FolderName name) { + UndeleteFolderRequest request = + UndeleteFolderRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return undeleteFolderAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   String name = FolderName.of("[FOLDER]").toString();
+   *   Folder response = foldersClient.undeleteFolderAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The resource name of the folder to undelete. Must be of the form + * `folders/{folder_id}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture undeleteFolderAsync(String name) { + UndeleteFolderRequest request = UndeleteFolderRequest.newBuilder().setName(name).build(); + return undeleteFolderAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   UndeleteFolderRequest request =
+   *       UndeleteFolderRequest.newBuilder().setName(FolderName.of("[FOLDER]").toString()).build();
+   *   Folder response = foldersClient.undeleteFolderAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture undeleteFolderAsync( + UndeleteFolderRequest request) { + return undeleteFolderOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   UndeleteFolderRequest request =
+   *       UndeleteFolderRequest.newBuilder().setName(FolderName.of("[FOLDER]").toString()).build();
+   *   OperationFuture future =
+   *       foldersClient.undeleteFolderOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Folder response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + undeleteFolderOperationCallable() { + return stub.undeleteFolderOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   UndeleteFolderRequest request =
+   *       UndeleteFolderRequest.newBuilder().setName(FolderName.of("[FOLDER]").toString()).build();
+   *   ApiFuture future = foldersClient.undeleteFolderCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable undeleteFolderCallable() { + return stub.undeleteFolderCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   ResourceName resource = TagValueName.of("[TAG_VALUE]");
+   *   Policy response = foldersClient.getIamPolicy(resource);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(ResourceName resource) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   String resource = TagValueName.of("[TAG_VALUE]").toString();
+   *   Policy response = foldersClient.getIamPolicy(resource);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(String resource) { + GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = foldersClient.getIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = foldersClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   ResourceName resource = TagValueName.of("[TAG_VALUE]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   Policy response = foldersClient.setIamPolicy(resource, policy);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(ResourceName resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setPolicy(policy) + .build(); + return setIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   String resource = TagValueName.of("[TAG_VALUE]").toString();
+   *   Policy policy = Policy.newBuilder().build();
+   *   Policy response = foldersClient.setIamPolicy(resource, policy);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(String resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); + return setIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .build();
+   *   Policy response = foldersClient.setIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = foldersClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   ResourceName resource = TagValueName.of("[TAG_VALUE]");
+   *   List permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response = foldersClient.testIamPermissions(resource, permissions);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param 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). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + ResourceName resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   String resource = TagValueName.of("[TAG_VALUE]").toString();
+   *   List permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response = foldersClient.testIamPermissions(resource, permissions);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param 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). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + String resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = foldersClient.testIamPermissions(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (FoldersClient foldersClient = FoldersClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       foldersClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListFoldersPagedResponse + extends AbstractPagedListResponse< + ListFoldersRequest, + ListFoldersResponse, + Folder, + ListFoldersPage, + ListFoldersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListFoldersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListFoldersPagedResponse apply(ListFoldersPage input) { + return new ListFoldersPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListFoldersPagedResponse(ListFoldersPage page) { + super(page, ListFoldersFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListFoldersPage + extends AbstractPage { + + private ListFoldersPage( + PageContext context, + ListFoldersResponse response) { + super(context, response); + } + + private static ListFoldersPage createEmptyPage() { + return new ListFoldersPage(null, null); + } + + @Override + protected ListFoldersPage createPage( + PageContext context, + ListFoldersResponse response) { + return new ListFoldersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListFoldersFixedSizeCollection + extends AbstractFixedSizeCollection< + ListFoldersRequest, + ListFoldersResponse, + Folder, + ListFoldersPage, + ListFoldersFixedSizeCollection> { + + private ListFoldersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListFoldersFixedSizeCollection createEmptyCollection() { + return new ListFoldersFixedSizeCollection(null, 0); + } + + @Override + protected ListFoldersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListFoldersFixedSizeCollection(pages, collectionSize); + } + } + + public static class SearchFoldersPagedResponse + extends AbstractPagedListResponse< + SearchFoldersRequest, + SearchFoldersResponse, + Folder, + SearchFoldersPage, + SearchFoldersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + SearchFoldersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public SearchFoldersPagedResponse apply(SearchFoldersPage input) { + return new SearchFoldersPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private SearchFoldersPagedResponse(SearchFoldersPage page) { + super(page, SearchFoldersFixedSizeCollection.createEmptyCollection()); + } + } + + public static class SearchFoldersPage + extends AbstractPage { + + private SearchFoldersPage( + PageContext context, + SearchFoldersResponse response) { + super(context, response); + } + + private static SearchFoldersPage createEmptyPage() { + return new SearchFoldersPage(null, null); + } + + @Override + protected SearchFoldersPage createPage( + PageContext context, + SearchFoldersResponse response) { + return new SearchFoldersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class SearchFoldersFixedSizeCollection + extends AbstractFixedSizeCollection< + SearchFoldersRequest, + SearchFoldersResponse, + Folder, + SearchFoldersPage, + SearchFoldersFixedSizeCollection> { + + private SearchFoldersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static SearchFoldersFixedSizeCollection createEmptyCollection() { + return new SearchFoldersFixedSizeCollection(null, 0); + } + + @Override + protected SearchFoldersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new SearchFoldersFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/FoldersSettings.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/FoldersSettings.java new file mode 100644 index 000000000000..d809b4754789 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/FoldersSettings.java @@ -0,0 +1,360 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import static com.google.cloud.resourcemanager.v3.FoldersClient.ListFoldersPagedResponse; +import static com.google.cloud.resourcemanager.v3.FoldersClient.SearchFoldersPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.resourcemanager.v3.stub.FoldersStubSettings; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link FoldersClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (cloudresourcemanager.googleapis.com) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getFolder to 30 seconds: + * + *

{@code
+ * FoldersSettings.Builder foldersSettingsBuilder = FoldersSettings.newBuilder();
+ * foldersSettingsBuilder
+ *     .getFolderSettings()
+ *     .setRetrySettings(
+ *         foldersSettingsBuilder
+ *             .getFolderSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * FoldersSettings foldersSettings = foldersSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class FoldersSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to getFolder. */ + public UnaryCallSettings getFolderSettings() { + return ((FoldersStubSettings) getStubSettings()).getFolderSettings(); + } + + /** Returns the object with the settings used for calls to listFolders. */ + public PagedCallSettings + listFoldersSettings() { + return ((FoldersStubSettings) getStubSettings()).listFoldersSettings(); + } + + /** Returns the object with the settings used for calls to searchFolders. */ + public PagedCallSettings + searchFoldersSettings() { + return ((FoldersStubSettings) getStubSettings()).searchFoldersSettings(); + } + + /** Returns the object with the settings used for calls to createFolder. */ + public UnaryCallSettings createFolderSettings() { + return ((FoldersStubSettings) getStubSettings()).createFolderSettings(); + } + + /** Returns the object with the settings used for calls to createFolder. */ + public OperationCallSettings + createFolderOperationSettings() { + return ((FoldersStubSettings) getStubSettings()).createFolderOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateFolder. */ + public UnaryCallSettings updateFolderSettings() { + return ((FoldersStubSettings) getStubSettings()).updateFolderSettings(); + } + + /** Returns the object with the settings used for calls to updateFolder. */ + public OperationCallSettings + updateFolderOperationSettings() { + return ((FoldersStubSettings) getStubSettings()).updateFolderOperationSettings(); + } + + /** Returns the object with the settings used for calls to moveFolder. */ + public UnaryCallSettings moveFolderSettings() { + return ((FoldersStubSettings) getStubSettings()).moveFolderSettings(); + } + + /** Returns the object with the settings used for calls to moveFolder. */ + public OperationCallSettings + moveFolderOperationSettings() { + return ((FoldersStubSettings) getStubSettings()).moveFolderOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteFolder. */ + public UnaryCallSettings deleteFolderSettings() { + return ((FoldersStubSettings) getStubSettings()).deleteFolderSettings(); + } + + /** Returns the object with the settings used for calls to deleteFolder. */ + public OperationCallSettings + deleteFolderOperationSettings() { + return ((FoldersStubSettings) getStubSettings()).deleteFolderOperationSettings(); + } + + /** Returns the object with the settings used for calls to undeleteFolder. */ + public UnaryCallSettings undeleteFolderSettings() { + return ((FoldersStubSettings) getStubSettings()).undeleteFolderSettings(); + } + + /** Returns the object with the settings used for calls to undeleteFolder. */ + public OperationCallSettings + undeleteFolderOperationSettings() { + return ((FoldersStubSettings) getStubSettings()).undeleteFolderOperationSettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((FoldersStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((FoldersStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((FoldersStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final FoldersSettings create(FoldersStubSettings stub) throws IOException { + return new FoldersSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return FoldersStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return FoldersStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return FoldersStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return FoldersStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return FoldersStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return FoldersStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return FoldersStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected FoldersSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for FoldersSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(FoldersStubSettings.newBuilder(clientContext)); + } + + protected Builder(FoldersSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(FoldersStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(FoldersStubSettings.newBuilder()); + } + + public FoldersStubSettings.Builder getStubSettingsBuilder() { + return ((FoldersStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to getFolder. */ + public UnaryCallSettings.Builder getFolderSettings() { + return getStubSettingsBuilder().getFolderSettings(); + } + + /** Returns the builder for the settings used for calls to listFolders. */ + public PagedCallSettings.Builder< + ListFoldersRequest, ListFoldersResponse, ListFoldersPagedResponse> + listFoldersSettings() { + return getStubSettingsBuilder().listFoldersSettings(); + } + + /** Returns the builder for the settings used for calls to searchFolders. */ + public PagedCallSettings.Builder< + SearchFoldersRequest, SearchFoldersResponse, SearchFoldersPagedResponse> + searchFoldersSettings() { + return getStubSettingsBuilder().searchFoldersSettings(); + } + + /** Returns the builder for the settings used for calls to createFolder. */ + public UnaryCallSettings.Builder createFolderSettings() { + return getStubSettingsBuilder().createFolderSettings(); + } + + /** Returns the builder for the settings used for calls to createFolder. */ + public OperationCallSettings.Builder + createFolderOperationSettings() { + return getStubSettingsBuilder().createFolderOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateFolder. */ + public UnaryCallSettings.Builder updateFolderSettings() { + return getStubSettingsBuilder().updateFolderSettings(); + } + + /** Returns the builder for the settings used for calls to updateFolder. */ + public OperationCallSettings.Builder + updateFolderOperationSettings() { + return getStubSettingsBuilder().updateFolderOperationSettings(); + } + + /** Returns the builder for the settings used for calls to moveFolder. */ + public UnaryCallSettings.Builder moveFolderSettings() { + return getStubSettingsBuilder().moveFolderSettings(); + } + + /** Returns the builder for the settings used for calls to moveFolder. */ + public OperationCallSettings.Builder + moveFolderOperationSettings() { + return getStubSettingsBuilder().moveFolderOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteFolder. */ + public UnaryCallSettings.Builder deleteFolderSettings() { + return getStubSettingsBuilder().deleteFolderSettings(); + } + + /** Returns the builder for the settings used for calls to deleteFolder. */ + public OperationCallSettings.Builder + deleteFolderOperationSettings() { + return getStubSettingsBuilder().deleteFolderOperationSettings(); + } + + /** Returns the builder for the settings used for calls to undeleteFolder. */ + public UnaryCallSettings.Builder undeleteFolderSettings() { + return getStubSettingsBuilder().undeleteFolderSettings(); + } + + /** Returns the builder for the settings used for calls to undeleteFolder. */ + public OperationCallSettings.Builder + undeleteFolderOperationSettings() { + return getStubSettingsBuilder().undeleteFolderOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public FoldersSettings build() throws IOException { + return new FoldersSettings(this); + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationsClient.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationsClient.java new file mode 100644 index 000000000000..517637ebbeb1 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationsClient.java @@ -0,0 +1,861 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.resourcenames.ResourceName; +import com.google.cloud.resourcemanager.v3.stub.OrganizationsStub; +import com.google.cloud.resourcemanager.v3.stub.OrganizationsStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Allows users to manage their organization resources. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * try (OrganizationsClient organizationsClient = OrganizationsClient.create()) {
+ *   OrganizationName name = OrganizationName.of("[ORGANIZATION]");
+ *   Organization response = organizationsClient.getOrganization(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the OrganizationsClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

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 parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of OrganizationsSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * OrganizationsSettings organizationsSettings =
+ *     OrganizationsSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * OrganizationsClient organizationsClient = OrganizationsClient.create(organizationsSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * OrganizationsSettings organizationsSettings =
+ *     OrganizationsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * OrganizationsClient organizationsClient = OrganizationsClient.create(organizationsSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class OrganizationsClient implements BackgroundResource { + private final OrganizationsSettings settings; + private final OrganizationsStub stub; + + /** Constructs an instance of OrganizationsClient with default settings. */ + public static final OrganizationsClient create() throws IOException { + return create(OrganizationsSettings.newBuilder().build()); + } + + /** + * Constructs an instance of OrganizationsClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final OrganizationsClient create(OrganizationsSettings settings) + throws IOException { + return new OrganizationsClient(settings); + } + + /** + * Constructs an instance of OrganizationsClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(OrganizationsSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final OrganizationsClient create(OrganizationsStub stub) { + return new OrganizationsClient(stub); + } + + /** + * Constructs an instance of OrganizationsClient, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected OrganizationsClient(OrganizationsSettings settings) throws IOException { + this.settings = settings; + this.stub = ((OrganizationsStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected OrganizationsClient(OrganizationsStub stub) { + this.settings = null; + this.stub = stub; + } + + public final OrganizationsSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public OrganizationsStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Fetches an organization resource identified by the specified resource name. + * + *

Sample code: + * + *

{@code
+   * try (OrganizationsClient organizationsClient = OrganizationsClient.create()) {
+   *   OrganizationName name = OrganizationName.of("[ORGANIZATION]");
+   *   Organization response = organizationsClient.getOrganization(name);
+   * }
+   * }
+ * + * @param 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". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Organization getOrganization(OrganizationName name) { + GetOrganizationRequest request = + GetOrganizationRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getOrganization(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Fetches an organization resource identified by the specified resource name. + * + *

Sample code: + * + *

{@code
+   * try (OrganizationsClient organizationsClient = OrganizationsClient.create()) {
+   *   String name = OrganizationName.of("[ORGANIZATION]").toString();
+   *   Organization response = organizationsClient.getOrganization(name);
+   * }
+   * }
+ * + * @param 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". + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Organization getOrganization(String name) { + GetOrganizationRequest request = GetOrganizationRequest.newBuilder().setName(name).build(); + return getOrganization(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Fetches an organization resource identified by the specified resource name. + * + *

Sample code: + * + *

{@code
+   * try (OrganizationsClient organizationsClient = OrganizationsClient.create()) {
+   *   GetOrganizationRequest request =
+   *       GetOrganizationRequest.newBuilder()
+   *           .setName(OrganizationName.of("[ORGANIZATION]").toString())
+   *           .build();
+   *   Organization response = organizationsClient.getOrganization(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Organization getOrganization(GetOrganizationRequest request) { + return getOrganizationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Fetches an organization resource identified by the specified resource name. + * + *

Sample code: + * + *

{@code
+   * try (OrganizationsClient organizationsClient = OrganizationsClient.create()) {
+   *   GetOrganizationRequest request =
+   *       GetOrganizationRequest.newBuilder()
+   *           .setName(OrganizationName.of("[ORGANIZATION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       organizationsClient.getOrganizationCallable().futureCall(request);
+   *   // Do something.
+   *   Organization response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getOrganizationCallable() { + return stub.getOrganizationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (OrganizationsClient organizationsClient = OrganizationsClient.create()) {
+   *   String query = "query107944136";
+   *   for (Organization element : organizationsClient.searchOrganizations(query).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param 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`. + *
+ * + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SearchOrganizationsPagedResponse searchOrganizations(String query) { + SearchOrganizationsRequest request = + SearchOrganizationsRequest.newBuilder().setQuery(query).build(); + return searchOrganizations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (OrganizationsClient organizationsClient = OrganizationsClient.create()) {
+   *   SearchOrganizationsRequest request =
+   *       SearchOrganizationsRequest.newBuilder()
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setQuery("query107944136")
+   *           .build();
+   *   for (Organization element : organizationsClient.searchOrganizations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SearchOrganizationsPagedResponse searchOrganizations( + SearchOrganizationsRequest request) { + return searchOrganizationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (OrganizationsClient organizationsClient = OrganizationsClient.create()) {
+   *   SearchOrganizationsRequest request =
+   *       SearchOrganizationsRequest.newBuilder()
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setQuery("query107944136")
+   *           .build();
+   *   ApiFuture future =
+   *       organizationsClient.searchOrganizationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Organization element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + searchOrganizationsPagedCallable() { + return stub.searchOrganizationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (OrganizationsClient organizationsClient = OrganizationsClient.create()) {
+   *   SearchOrganizationsRequest request =
+   *       SearchOrganizationsRequest.newBuilder()
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setQuery("query107944136")
+   *           .build();
+   *   while (true) {
+   *     SearchOrganizationsResponse response =
+   *         organizationsClient.searchOrganizationsCallable().call(request);
+   *     for (Organization element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + searchOrganizationsCallable() { + return stub.searchOrganizationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (OrganizationsClient organizationsClient = OrganizationsClient.create()) {
+   *   ResourceName resource = TagValueName.of("[TAG_VALUE]");
+   *   Policy response = organizationsClient.getIamPolicy(resource);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(ResourceName resource) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (OrganizationsClient organizationsClient = OrganizationsClient.create()) {
+   *   String resource = TagValueName.of("[TAG_VALUE]").toString();
+   *   Policy response = organizationsClient.getIamPolicy(resource);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(String resource) { + GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (OrganizationsClient organizationsClient = OrganizationsClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = organizationsClient.getIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (OrganizationsClient organizationsClient = OrganizationsClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = organizationsClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (OrganizationsClient organizationsClient = OrganizationsClient.create()) {
+   *   ResourceName resource = TagValueName.of("[TAG_VALUE]");
+   *   Policy response = organizationsClient.setIamPolicy(resource);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(ResourceName resource) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .build(); + return setIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (OrganizationsClient organizationsClient = OrganizationsClient.create()) {
+   *   String resource = TagValueName.of("[TAG_VALUE]").toString();
+   *   Policy response = organizationsClient.setIamPolicy(resource);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(String resource) { + SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder().setResource(resource).build(); + return setIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (OrganizationsClient organizationsClient = OrganizationsClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .build();
+   *   Policy response = organizationsClient.setIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (OrganizationsClient organizationsClient = OrganizationsClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = organizationsClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (OrganizationsClient organizationsClient = OrganizationsClient.create()) {
+   *   ResourceName resource = TagValueName.of("[TAG_VALUE]");
+   *   List permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response =
+   *       organizationsClient.testIamPermissions(resource, permissions);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param 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). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + ResourceName resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (OrganizationsClient organizationsClient = OrganizationsClient.create()) {
+   *   String resource = TagValueName.of("[TAG_VALUE]").toString();
+   *   List permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response =
+   *       organizationsClient.testIamPermissions(resource, permissions);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param 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). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + String resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (OrganizationsClient organizationsClient = OrganizationsClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = organizationsClient.testIamPermissions(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (OrganizationsClient organizationsClient = OrganizationsClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       organizationsClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class SearchOrganizationsPagedResponse + extends AbstractPagedListResponse< + SearchOrganizationsRequest, + SearchOrganizationsResponse, + Organization, + SearchOrganizationsPage, + SearchOrganizationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + SearchOrganizationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public SearchOrganizationsPagedResponse apply(SearchOrganizationsPage input) { + return new SearchOrganizationsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private SearchOrganizationsPagedResponse(SearchOrganizationsPage page) { + super(page, SearchOrganizationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class SearchOrganizationsPage + extends AbstractPage< + SearchOrganizationsRequest, + SearchOrganizationsResponse, + Organization, + SearchOrganizationsPage> { + + private SearchOrganizationsPage( + PageContext context, + SearchOrganizationsResponse response) { + super(context, response); + } + + private static SearchOrganizationsPage createEmptyPage() { + return new SearchOrganizationsPage(null, null); + } + + @Override + protected SearchOrganizationsPage createPage( + PageContext context, + SearchOrganizationsResponse response) { + return new SearchOrganizationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class SearchOrganizationsFixedSizeCollection + extends AbstractFixedSizeCollection< + SearchOrganizationsRequest, + SearchOrganizationsResponse, + Organization, + SearchOrganizationsPage, + SearchOrganizationsFixedSizeCollection> { + + private SearchOrganizationsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static SearchOrganizationsFixedSizeCollection createEmptyCollection() { + return new SearchOrganizationsFixedSizeCollection(null, 0); + } + + @Override + protected SearchOrganizationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new SearchOrganizationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationsSettings.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationsSettings.java new file mode 100644 index 000000000000..f6e21592132a --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationsSettings.java @@ -0,0 +1,239 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import static com.google.cloud.resourcemanager.v3.OrganizationsClient.SearchOrganizationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.resourcemanager.v3.stub.OrganizationsStubSettings; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link OrganizationsClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (cloudresourcemanager.googleapis.com) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getOrganization to 30 seconds: + * + *

{@code
+ * OrganizationsSettings.Builder organizationsSettingsBuilder = OrganizationsSettings.newBuilder();
+ * organizationsSettingsBuilder
+ *     .getOrganizationSettings()
+ *     .setRetrySettings(
+ *         organizationsSettingsBuilder
+ *             .getOrganizationSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * OrganizationsSettings organizationsSettings = organizationsSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class OrganizationsSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to getOrganization. */ + public UnaryCallSettings getOrganizationSettings() { + return ((OrganizationsStubSettings) getStubSettings()).getOrganizationSettings(); + } + + /** Returns the object with the settings used for calls to searchOrganizations. */ + public PagedCallSettings< + SearchOrganizationsRequest, SearchOrganizationsResponse, SearchOrganizationsPagedResponse> + searchOrganizationsSettings() { + return ((OrganizationsStubSettings) getStubSettings()).searchOrganizationsSettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((OrganizationsStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((OrganizationsStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((OrganizationsStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final OrganizationsSettings create(OrganizationsStubSettings stub) + throws IOException { + return new OrganizationsSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return OrganizationsStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return OrganizationsStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return OrganizationsStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return OrganizationsStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return OrganizationsStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return OrganizationsStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return OrganizationsStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected OrganizationsSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for OrganizationsSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(OrganizationsStubSettings.newBuilder(clientContext)); + } + + protected Builder(OrganizationsSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(OrganizationsStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(OrganizationsStubSettings.newBuilder()); + } + + public OrganizationsStubSettings.Builder getStubSettingsBuilder() { + return ((OrganizationsStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to getOrganization. */ + public UnaryCallSettings.Builder + getOrganizationSettings() { + return getStubSettingsBuilder().getOrganizationSettings(); + } + + /** Returns the builder for the settings used for calls to searchOrganizations. */ + public PagedCallSettings.Builder< + SearchOrganizationsRequest, + SearchOrganizationsResponse, + SearchOrganizationsPagedResponse> + searchOrganizationsSettings() { + return getStubSettingsBuilder().searchOrganizationsSettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public OrganizationsSettings build() throws IOException { + return new OrganizationsSettings(this); + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/ProjectsClient.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/ProjectsClient.java new file mode 100644 index 000000000000..7e66a03abb49 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/ProjectsClient.java @@ -0,0 +1,2062 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.resourcenames.ResourceName; +import com.google.cloud.resourcemanager.v3.stub.ProjectsStub; +import com.google.cloud.resourcemanager.v3.stub.ProjectsStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Manages Google Cloud Projects. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+ *   ProjectName name = ProjectName.of("[PROJECT]");
+ *   Project response = projectsClient.getProject(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the ProjectsClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

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 parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of ProjectsSettings to create(). + * For example: + * + *

To customize credentials: + * + *

{@code
+ * ProjectsSettings projectsSettings =
+ *     ProjectsSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ProjectsClient projectsClient = ProjectsClient.create(projectsSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * ProjectsSettings projectsSettings =
+ *     ProjectsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ProjectsClient projectsClient = ProjectsClient.create(projectsSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class ProjectsClient implements BackgroundResource { + private final ProjectsSettings settings; + private final ProjectsStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of ProjectsClient with default settings. */ + public static final ProjectsClient create() throws IOException { + return create(ProjectsSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ProjectsClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final ProjectsClient create(ProjectsSettings settings) throws IOException { + return new ProjectsClient(settings); + } + + /** + * Constructs an instance of ProjectsClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(ProjectsSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final ProjectsClient create(ProjectsStub stub) { + return new ProjectsClient(stub); + } + + /** + * Constructs an instance of ProjectsClient, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected ProjectsClient(ProjectsSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ProjectsStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected ProjectsClient(ProjectsStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final ProjectsSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ProjectsStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   Project response = projectsClient.getProject(name);
+   * }
+   * }
+ * + * @param name Required. The name of the project (for example, `projects/415104041262`). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Project getProject(ProjectName name) { + GetProjectRequest request = + GetProjectRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getProject(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   String name = ProjectName.of("[PROJECT]").toString();
+   *   Project response = projectsClient.getProject(name);
+   * }
+   * }
+ * + * @param name Required. The name of the project (for example, `projects/415104041262`). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Project getProject(String name) { + GetProjectRequest request = GetProjectRequest.newBuilder().setName(name).build(); + return getProject(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   GetProjectRequest request =
+   *       GetProjectRequest.newBuilder().setName(ProjectName.of("[PROJECT]").toString()).build();
+   *   Project response = projectsClient.getProject(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Project getProject(GetProjectRequest request) { + return getProjectCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   GetProjectRequest request =
+   *       GetProjectRequest.newBuilder().setName(ProjectName.of("[PROJECT]").toString()).build();
+   *   ApiFuture future = projectsClient.getProjectCallable().futureCall(request);
+   *   // Do something.
+   *   Project response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getProjectCallable() { + return stub.getProjectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   ResourceName parent = TagValueName.of("[TAG_VALUE]");
+   *   for (Project element : projectsClient.listProjects(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource to list projects under. + *

For example, setting this field to 'folders/1234' would list all projects directly under + * that folder. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProjectsPagedResponse listProjects(ResourceName parent) { + ListProjectsRequest request = + ListProjectsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listProjects(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   String parent = TagValueName.of("[TAG_VALUE]").toString();
+   *   for (Project element : projectsClient.listProjects(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the parent resource to list projects under. + *

For example, setting this field to 'folders/1234' would list all projects directly under + * that folder. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProjectsPagedResponse listProjects(String parent) { + ListProjectsRequest request = ListProjectsRequest.newBuilder().setParent(parent).build(); + return listProjects(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   ListProjectsRequest request =
+   *       ListProjectsRequest.newBuilder()
+   *           .setParent(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .setShowDeleted(true)
+   *           .build();
+   *   for (Project element : projectsClient.listProjects(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProjectsPagedResponse listProjects(ListProjectsRequest request) { + return listProjectsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   ListProjectsRequest request =
+   *       ListProjectsRequest.newBuilder()
+   *           .setParent(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .setShowDeleted(true)
+   *           .build();
+   *   ApiFuture future = projectsClient.listProjectsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Project element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listProjectsPagedCallable() { + return stub.listProjectsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   ListProjectsRequest request =
+   *       ListProjectsRequest.newBuilder()
+   *           .setParent(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .setShowDeleted(true)
+   *           .build();
+   *   while (true) {
+   *     ListProjectsResponse response = projectsClient.listProjectsCallable().call(request);
+   *     for (Project element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listProjectsCallable() { + return stub.listProjectsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   String query = "query107944136";
+   *   for (Project element : projectsClient.searchProjects(query).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param 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, + * the it will return results that match any of the fields. Some eligible fields are: + *

| Field | Description | + * |-------------------------|----------------------------------------------| | 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.<key> (where + * *key* is the name of a label) | Filters by label name. | + *

Search expressions are case insensitive. + *

Some examples queries: + *

| Query | Description | + * |------------------|-----------------------------------------------------| | 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&nbsp;labels.size:big + * | The project's label `color` has the value `red` and 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SearchProjectsPagedResponse searchProjects(String query) { + SearchProjectsRequest request = SearchProjectsRequest.newBuilder().setQuery(query).build(); + return searchProjects(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   SearchProjectsRequest request =
+   *       SearchProjectsRequest.newBuilder()
+   *           .setQuery("query107944136")
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .build();
+   *   for (Project element : projectsClient.searchProjects(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SearchProjectsPagedResponse searchProjects(SearchProjectsRequest request) { + return searchProjectsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   SearchProjectsRequest request =
+   *       SearchProjectsRequest.newBuilder()
+   *           .setQuery("query107944136")
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .build();
+   *   ApiFuture future = projectsClient.searchProjectsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Project element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + searchProjectsPagedCallable() { + return stub.searchProjectsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   SearchProjectsRequest request =
+   *       SearchProjectsRequest.newBuilder()
+   *           .setQuery("query107944136")
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .build();
+   *   while (true) {
+   *     SearchProjectsResponse response = projectsClient.searchProjectsCallable().call(request);
+   *     for (Project element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + searchProjectsCallable() { + return stub.searchProjectsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   Project project = Project.newBuilder().build();
+   *   Project response = projectsClient.createProjectAsync(project).get();
+   * }
+   * }
+ * + * @param 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 Organziation, the parent will be set to that Organization. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createProjectAsync(Project project) { + CreateProjectRequest request = CreateProjectRequest.newBuilder().setProject(project).build(); + return createProjectAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   CreateProjectRequest request =
+   *       CreateProjectRequest.newBuilder().setProject(Project.newBuilder().build()).build();
+   *   Project response = projectsClient.createProjectAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createProjectAsync( + CreateProjectRequest request) { + return createProjectOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   CreateProjectRequest request =
+   *       CreateProjectRequest.newBuilder().setProject(Project.newBuilder().build()).build();
+   *   OperationFuture future =
+   *       projectsClient.createProjectOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Project response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createProjectOperationCallable() { + return stub.createProjectOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   CreateProjectRequest request =
+   *       CreateProjectRequest.newBuilder().setProject(Project.newBuilder().build()).build();
+   *   ApiFuture future = projectsClient.createProjectCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createProjectCallable() { + return stub.createProjectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   Project project = Project.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Project response = projectsClient.updateProjectAsync(project, updateMask).get();
+   * }
+   * }
+ * + * @param project Required. The new definition of the project. + * @param updateMask Optional. An update mask to selectively update fields. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateProjectAsync( + Project project, FieldMask updateMask) { + UpdateProjectRequest request = + UpdateProjectRequest.newBuilder().setProject(project).setUpdateMask(updateMask).build(); + return updateProjectAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   UpdateProjectRequest request =
+   *       UpdateProjectRequest.newBuilder()
+   *           .setProject(Project.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Project response = projectsClient.updateProjectAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateProjectAsync( + UpdateProjectRequest request) { + return updateProjectOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   UpdateProjectRequest request =
+   *       UpdateProjectRequest.newBuilder()
+   *           .setProject(Project.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       projectsClient.updateProjectOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Project response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateProjectOperationCallable() { + return stub.updateProjectOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   UpdateProjectRequest request =
+   *       UpdateProjectRequest.newBuilder()
+   *           .setProject(Project.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = projectsClient.updateProjectCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateProjectCallable() { + return stub.updateProjectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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.update` permission on the project and have + * `resourcemanager.projects.move` permission on the project's current and proposed new parent. + * + *

Sample code: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName destinationParent = TagValueName.of("[TAG_VALUE]");
+   *   Project response = projectsClient.moveProjectAsync(name, destinationParent).get();
+   * }
+   * }
+ * + * @param name Required. The name of the project to move. + * @param destinationParent Required. The new parent to move the Project under. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture moveProjectAsync( + ProjectName name, ResourceName destinationParent) { + MoveProjectRequest request = + MoveProjectRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setDestinationParent(destinationParent == null ? null : destinationParent.toString()) + .build(); + return moveProjectAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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.update` permission on the project and have + * `resourcemanager.projects.move` permission on the project's current and proposed new parent. + * + *

Sample code: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   String destinationParent = TagValueName.of("[TAG_VALUE]").toString();
+   *   Project response = projectsClient.moveProjectAsync(name, destinationParent).get();
+   * }
+   * }
+ * + * @param name Required. The name of the project to move. + * @param destinationParent Required. The new parent to move the Project under. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture moveProjectAsync( + ProjectName name, String destinationParent) { + MoveProjectRequest request = + MoveProjectRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setDestinationParent(destinationParent) + .build(); + return moveProjectAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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.update` permission on the project and have + * `resourcemanager.projects.move` permission on the project's current and proposed new parent. + * + *

Sample code: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   String name = ProjectName.of("[PROJECT]").toString();
+   *   ResourceName destinationParent = TagValueName.of("[TAG_VALUE]");
+   *   Project response = projectsClient.moveProjectAsync(name, destinationParent).get();
+   * }
+   * }
+ * + * @param name Required. The name of the project to move. + * @param destinationParent Required. The new parent to move the Project under. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture moveProjectAsync( + String name, ResourceName destinationParent) { + MoveProjectRequest request = + MoveProjectRequest.newBuilder() + .setName(name) + .setDestinationParent(destinationParent == null ? null : destinationParent.toString()) + .build(); + return moveProjectAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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.update` permission on the project and have + * `resourcemanager.projects.move` permission on the project's current and proposed new parent. + * + *

Sample code: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   String name = ProjectName.of("[PROJECT]").toString();
+   *   String destinationParent = TagValueName.of("[TAG_VALUE]").toString();
+   *   Project response = projectsClient.moveProjectAsync(name, destinationParent).get();
+   * }
+   * }
+ * + * @param name Required. The name of the project to move. + * @param destinationParent Required. The new parent to move the Project under. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture moveProjectAsync( + String name, String destinationParent) { + MoveProjectRequest request = + MoveProjectRequest.newBuilder() + .setName(name) + .setDestinationParent(destinationParent) + .build(); + return moveProjectAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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.update` permission on the project and have + * `resourcemanager.projects.move` permission on the project's current and proposed new parent. + * + *

Sample code: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   MoveProjectRequest request =
+   *       MoveProjectRequest.newBuilder()
+   *           .setName(ProjectName.of("[PROJECT]").toString())
+   *           .setDestinationParent(TagValueName.of("[TAG_VALUE]").toString())
+   *           .build();
+   *   Project response = projectsClient.moveProjectAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture moveProjectAsync( + MoveProjectRequest request) { + return moveProjectOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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.update` permission on the project and have + * `resourcemanager.projects.move` permission on the project's current and proposed new parent. + * + *

Sample code: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   MoveProjectRequest request =
+   *       MoveProjectRequest.newBuilder()
+   *           .setName(ProjectName.of("[PROJECT]").toString())
+   *           .setDestinationParent(TagValueName.of("[TAG_VALUE]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       projectsClient.moveProjectOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Project response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + moveProjectOperationCallable() { + return stub.moveProjectOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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.update` permission on the project and have + * `resourcemanager.projects.move` permission on the project's current and proposed new parent. + * + *

Sample code: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   MoveProjectRequest request =
+   *       MoveProjectRequest.newBuilder()
+   *           .setName(ProjectName.of("[PROJECT]").toString())
+   *           .setDestinationParent(TagValueName.of("[TAG_VALUE]").toString())
+   *           .build();
+   *   ApiFuture future = projectsClient.moveProjectCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable moveProjectCallable() { + return stub.moveProjectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   Project response = projectsClient.deleteProjectAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the Project (for example, `projects/415104041262`). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteProjectAsync( + ProjectName name) { + DeleteProjectRequest request = + DeleteProjectRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteProjectAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   String name = ProjectName.of("[PROJECT]").toString();
+   *   Project response = projectsClient.deleteProjectAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the Project (for example, `projects/415104041262`). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteProjectAsync(String name) { + DeleteProjectRequest request = DeleteProjectRequest.newBuilder().setName(name).build(); + return deleteProjectAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   DeleteProjectRequest request =
+   *       DeleteProjectRequest.newBuilder().setName(ProjectName.of("[PROJECT]").toString()).build();
+   *   Project response = projectsClient.deleteProjectAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteProjectAsync( + DeleteProjectRequest request) { + return deleteProjectOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   DeleteProjectRequest request =
+   *       DeleteProjectRequest.newBuilder().setName(ProjectName.of("[PROJECT]").toString()).build();
+   *   OperationFuture future =
+   *       projectsClient.deleteProjectOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Project response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteProjectOperationCallable() { + return stub.deleteProjectOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   DeleteProjectRequest request =
+   *       DeleteProjectRequest.newBuilder().setName(ProjectName.of("[PROJECT]").toString()).build();
+   *   ApiFuture future = projectsClient.deleteProjectCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteProjectCallable() { + return stub.deleteProjectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   Project response = projectsClient.undeleteProjectAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the project (for example, `projects/415104041262`). + *

Required. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture undeleteProjectAsync( + ProjectName name) { + UndeleteProjectRequest request = + UndeleteProjectRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return undeleteProjectAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   String name = ProjectName.of("[PROJECT]").toString();
+   *   Project response = projectsClient.undeleteProjectAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the project (for example, `projects/415104041262`). + *

Required. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture undeleteProjectAsync(String name) { + UndeleteProjectRequest request = UndeleteProjectRequest.newBuilder().setName(name).build(); + return undeleteProjectAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   UndeleteProjectRequest request =
+   *       UndeleteProjectRequest.newBuilder()
+   *           .setName(ProjectName.of("[PROJECT]").toString())
+   *           .build();
+   *   Project response = projectsClient.undeleteProjectAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture undeleteProjectAsync( + UndeleteProjectRequest request) { + return undeleteProjectOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   UndeleteProjectRequest request =
+   *       UndeleteProjectRequest.newBuilder()
+   *           .setName(ProjectName.of("[PROJECT]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       projectsClient.undeleteProjectOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Project response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + undeleteProjectOperationCallable() { + return stub.undeleteProjectOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   UndeleteProjectRequest request =
+   *       UndeleteProjectRequest.newBuilder()
+   *           .setName(ProjectName.of("[PROJECT]").toString())
+   *           .build();
+   *   ApiFuture future = projectsClient.undeleteProjectCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable undeleteProjectCallable() { + return stub.undeleteProjectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the IAM access control policy for the specified project. Permission is denied if the + * policy or the resource do not exist. + * + *

Sample code: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   ResourceName resource = TagValueName.of("[TAG_VALUE]");
+   *   Policy response = projectsClient.getIamPolicy(resource);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(ResourceName resource) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the IAM access control policy for the specified project. Permission is denied if the + * policy or the resource do not exist. + * + *

Sample code: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   String resource = TagValueName.of("[TAG_VALUE]").toString();
+   *   Policy response = projectsClient.getIamPolicy(resource);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(String resource) { + GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the IAM access control policy for the specified project. Permission is denied if the + * policy or the resource do not exist. + * + *

Sample code: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = projectsClient.getIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the IAM access control policy for the specified project. Permission is denied if the + * policy or the resource do not exist. + * + *

Sample code: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = projectsClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the IAM access control policy for the specified project. + * + *

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{@literal @}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. + * + *

+ Membership changes that leave the project without any owners that have accepted the Terms + * of Service (ToS) will be rejected. + * + *

+ 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. + * + *

+ Calling this method requires enabling the App Engine Admin API. + * + *

Sample code: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   ResourceName resource = TagValueName.of("[TAG_VALUE]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   Policy response = projectsClient.setIamPolicy(resource, policy);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(ResourceName resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setPolicy(policy) + .build(); + return setIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the IAM access control policy for the specified project. + * + *

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{@literal @}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. + * + *

+ Membership changes that leave the project without any owners that have accepted the Terms + * of Service (ToS) will be rejected. + * + *

+ 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. + * + *

+ Calling this method requires enabling the App Engine Admin API. + * + *

Sample code: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   String resource = TagValueName.of("[TAG_VALUE]").toString();
+   *   Policy policy = Policy.newBuilder().build();
+   *   Policy response = projectsClient.setIamPolicy(resource, policy);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(String resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); + return setIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the IAM access control policy for the specified project. + * + *

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{@literal @}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. + * + *

+ Membership changes that leave the project without any owners that have accepted the Terms + * of Service (ToS) will be rejected. + * + *

+ 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. + * + *

+ Calling this method requires enabling the App Engine Admin API. + * + *

Sample code: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .build();
+   *   Policy response = projectsClient.setIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the IAM access control policy for the specified project. + * + *

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{@literal @}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. + * + *

+ Membership changes that leave the project without any owners that have accepted the Terms + * of Service (ToS) will be rejected. + * + *

+ 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. + * + *

+ Calling this method requires enabling the App Engine Admin API. + * + *

Sample code: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = projectsClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified project. + * + *

Sample code: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   ResourceName resource = TagValueName.of("[TAG_VALUE]");
+   *   List permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response =
+   *       projectsClient.testIamPermissions(resource, permissions);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param 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). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + ResourceName resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified project. + * + *

Sample code: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   String resource = TagValueName.of("[TAG_VALUE]").toString();
+   *   List permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response =
+   *       projectsClient.testIamPermissions(resource, permissions);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param 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). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + String resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified project. + * + *

Sample code: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = projectsClient.testIamPermissions(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified project. + * + *

Sample code: + * + *

{@code
+   * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       projectsClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListProjectsPagedResponse + extends AbstractPagedListResponse< + ListProjectsRequest, + ListProjectsResponse, + Project, + ListProjectsPage, + ListProjectsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListProjectsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListProjectsPagedResponse apply(ListProjectsPage input) { + return new ListProjectsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListProjectsPagedResponse(ListProjectsPage page) { + super(page, ListProjectsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListProjectsPage + extends AbstractPage { + + private ListProjectsPage( + PageContext context, + ListProjectsResponse response) { + super(context, response); + } + + private static ListProjectsPage createEmptyPage() { + return new ListProjectsPage(null, null); + } + + @Override + protected ListProjectsPage createPage( + PageContext context, + ListProjectsResponse response) { + return new ListProjectsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListProjectsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListProjectsRequest, + ListProjectsResponse, + Project, + ListProjectsPage, + ListProjectsFixedSizeCollection> { + + private ListProjectsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListProjectsFixedSizeCollection createEmptyCollection() { + return new ListProjectsFixedSizeCollection(null, 0); + } + + @Override + protected ListProjectsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListProjectsFixedSizeCollection(pages, collectionSize); + } + } + + public static class SearchProjectsPagedResponse + extends AbstractPagedListResponse< + SearchProjectsRequest, + SearchProjectsResponse, + Project, + SearchProjectsPage, + SearchProjectsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + SearchProjectsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public SearchProjectsPagedResponse apply(SearchProjectsPage input) { + return new SearchProjectsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private SearchProjectsPagedResponse(SearchProjectsPage page) { + super(page, SearchProjectsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class SearchProjectsPage + extends AbstractPage< + SearchProjectsRequest, SearchProjectsResponse, Project, SearchProjectsPage> { + + private SearchProjectsPage( + PageContext context, + SearchProjectsResponse response) { + super(context, response); + } + + private static SearchProjectsPage createEmptyPage() { + return new SearchProjectsPage(null, null); + } + + @Override + protected SearchProjectsPage createPage( + PageContext context, + SearchProjectsResponse response) { + return new SearchProjectsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class SearchProjectsFixedSizeCollection + extends AbstractFixedSizeCollection< + SearchProjectsRequest, + SearchProjectsResponse, + Project, + SearchProjectsPage, + SearchProjectsFixedSizeCollection> { + + private SearchProjectsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static SearchProjectsFixedSizeCollection createEmptyCollection() { + return new SearchProjectsFixedSizeCollection(null, 0); + } + + @Override + protected SearchProjectsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new SearchProjectsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/ProjectsSettings.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/ProjectsSettings.java new file mode 100644 index 000000000000..7cc3b8d42965 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/ProjectsSettings.java @@ -0,0 +1,361 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import static com.google.cloud.resourcemanager.v3.ProjectsClient.ListProjectsPagedResponse; +import static com.google.cloud.resourcemanager.v3.ProjectsClient.SearchProjectsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.resourcemanager.v3.stub.ProjectsStubSettings; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link ProjectsClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (cloudresourcemanager.googleapis.com) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getProject to 30 seconds: + * + *

{@code
+ * ProjectsSettings.Builder projectsSettingsBuilder = ProjectsSettings.newBuilder();
+ * projectsSettingsBuilder
+ *     .getProjectSettings()
+ *     .setRetrySettings(
+ *         projectsSettingsBuilder
+ *             .getProjectSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ProjectsSettings projectsSettings = projectsSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ProjectsSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to getProject. */ + public UnaryCallSettings getProjectSettings() { + return ((ProjectsStubSettings) getStubSettings()).getProjectSettings(); + } + + /** Returns the object with the settings used for calls to listProjects. */ + public PagedCallSettings + listProjectsSettings() { + return ((ProjectsStubSettings) getStubSettings()).listProjectsSettings(); + } + + /** Returns the object with the settings used for calls to searchProjects. */ + public PagedCallSettings< + SearchProjectsRequest, SearchProjectsResponse, SearchProjectsPagedResponse> + searchProjectsSettings() { + return ((ProjectsStubSettings) getStubSettings()).searchProjectsSettings(); + } + + /** Returns the object with the settings used for calls to createProject. */ + public UnaryCallSettings createProjectSettings() { + return ((ProjectsStubSettings) getStubSettings()).createProjectSettings(); + } + + /** Returns the object with the settings used for calls to createProject. */ + public OperationCallSettings + createProjectOperationSettings() { + return ((ProjectsStubSettings) getStubSettings()).createProjectOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateProject. */ + public UnaryCallSettings updateProjectSettings() { + return ((ProjectsStubSettings) getStubSettings()).updateProjectSettings(); + } + + /** Returns the object with the settings used for calls to updateProject. */ + public OperationCallSettings + updateProjectOperationSettings() { + return ((ProjectsStubSettings) getStubSettings()).updateProjectOperationSettings(); + } + + /** Returns the object with the settings used for calls to moveProject. */ + public UnaryCallSettings moveProjectSettings() { + return ((ProjectsStubSettings) getStubSettings()).moveProjectSettings(); + } + + /** Returns the object with the settings used for calls to moveProject. */ + public OperationCallSettings + moveProjectOperationSettings() { + return ((ProjectsStubSettings) getStubSettings()).moveProjectOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteProject. */ + public UnaryCallSettings deleteProjectSettings() { + return ((ProjectsStubSettings) getStubSettings()).deleteProjectSettings(); + } + + /** Returns the object with the settings used for calls to deleteProject. */ + public OperationCallSettings + deleteProjectOperationSettings() { + return ((ProjectsStubSettings) getStubSettings()).deleteProjectOperationSettings(); + } + + /** Returns the object with the settings used for calls to undeleteProject. */ + public UnaryCallSettings undeleteProjectSettings() { + return ((ProjectsStubSettings) getStubSettings()).undeleteProjectSettings(); + } + + /** Returns the object with the settings used for calls to undeleteProject. */ + public OperationCallSettings + undeleteProjectOperationSettings() { + return ((ProjectsStubSettings) getStubSettings()).undeleteProjectOperationSettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((ProjectsStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((ProjectsStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((ProjectsStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final ProjectsSettings create(ProjectsStubSettings stub) throws IOException { + return new ProjectsSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ProjectsStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ProjectsStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ProjectsStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ProjectsStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ProjectsStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ProjectsStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ProjectsStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ProjectsSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ProjectsSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ProjectsStubSettings.newBuilder(clientContext)); + } + + protected Builder(ProjectsSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ProjectsStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ProjectsStubSettings.newBuilder()); + } + + public ProjectsStubSettings.Builder getStubSettingsBuilder() { + return ((ProjectsStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to getProject. */ + public UnaryCallSettings.Builder getProjectSettings() { + return getStubSettingsBuilder().getProjectSettings(); + } + + /** Returns the builder for the settings used for calls to listProjects. */ + public PagedCallSettings.Builder< + ListProjectsRequest, ListProjectsResponse, ListProjectsPagedResponse> + listProjectsSettings() { + return getStubSettingsBuilder().listProjectsSettings(); + } + + /** Returns the builder for the settings used for calls to searchProjects. */ + public PagedCallSettings.Builder< + SearchProjectsRequest, SearchProjectsResponse, SearchProjectsPagedResponse> + searchProjectsSettings() { + return getStubSettingsBuilder().searchProjectsSettings(); + } + + /** Returns the builder for the settings used for calls to createProject. */ + public UnaryCallSettings.Builder createProjectSettings() { + return getStubSettingsBuilder().createProjectSettings(); + } + + /** Returns the builder for the settings used for calls to createProject. */ + public OperationCallSettings.Builder + createProjectOperationSettings() { + return getStubSettingsBuilder().createProjectOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateProject. */ + public UnaryCallSettings.Builder updateProjectSettings() { + return getStubSettingsBuilder().updateProjectSettings(); + } + + /** Returns the builder for the settings used for calls to updateProject. */ + public OperationCallSettings.Builder + updateProjectOperationSettings() { + return getStubSettingsBuilder().updateProjectOperationSettings(); + } + + /** Returns the builder for the settings used for calls to moveProject. */ + public UnaryCallSettings.Builder moveProjectSettings() { + return getStubSettingsBuilder().moveProjectSettings(); + } + + /** Returns the builder for the settings used for calls to moveProject. */ + public OperationCallSettings.Builder + moveProjectOperationSettings() { + return getStubSettingsBuilder().moveProjectOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteProject. */ + public UnaryCallSettings.Builder deleteProjectSettings() { + return getStubSettingsBuilder().deleteProjectSettings(); + } + + /** Returns the builder for the settings used for calls to deleteProject. */ + public OperationCallSettings.Builder + deleteProjectOperationSettings() { + return getStubSettingsBuilder().deleteProjectOperationSettings(); + } + + /** Returns the builder for the settings used for calls to undeleteProject. */ + public UnaryCallSettings.Builder undeleteProjectSettings() { + return getStubSettingsBuilder().undeleteProjectSettings(); + } + + /** Returns the builder for the settings used for calls to undeleteProject. */ + public OperationCallSettings.Builder + undeleteProjectOperationSettings() { + return getStubSettingsBuilder().undeleteProjectOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public ProjectsSettings build() throws IOException { + return new ProjectsSettings(this); + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagBindingsClient.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagBindingsClient.java new file mode 100644 index 000000000000..bbbaefbdcb45 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagBindingsClient.java @@ -0,0 +1,656 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.resourcenames.ResourceName; +import com.google.cloud.resourcemanager.v3.stub.TagBindingsStub; +import com.google.cloud.resourcemanager.v3.stub.TagBindingsStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Allow users to create and manage TagBindings between TagValues and different + * cloud resources throughout the GCP resource hierarchy. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * try (TagBindingsClient tagBindingsClient = TagBindingsClient.create()) {
+ *   ResourceName parent = TagValueName.of("[TAG_VALUE]");
+ *   for (TagBinding element : tagBindingsClient.listTagBindings(parent).iterateAll()) {
+ *     // doThingsWith(element);
+ *   }
+ * }
+ * }
+ * + *

Note: close() needs to be called on the TagBindingsClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

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 parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of TagBindingsSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * TagBindingsSettings tagBindingsSettings =
+ *     TagBindingsSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * TagBindingsClient tagBindingsClient = TagBindingsClient.create(tagBindingsSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * TagBindingsSettings tagBindingsSettings =
+ *     TagBindingsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * TagBindingsClient tagBindingsClient = TagBindingsClient.create(tagBindingsSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class TagBindingsClient implements BackgroundResource { + private final TagBindingsSettings settings; + private final TagBindingsStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of TagBindingsClient with default settings. */ + public static final TagBindingsClient create() throws IOException { + return create(TagBindingsSettings.newBuilder().build()); + } + + /** + * Constructs an instance of TagBindingsClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final TagBindingsClient create(TagBindingsSettings settings) throws IOException { + return new TagBindingsClient(settings); + } + + /** + * Constructs an instance of TagBindingsClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(TagBindingsSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final TagBindingsClient create(TagBindingsStub stub) { + return new TagBindingsClient(stub); + } + + /** + * Constructs an instance of TagBindingsClient, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected TagBindingsClient(TagBindingsSettings settings) throws IOException { + this.settings = settings; + this.stub = ((TagBindingsStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected TagBindingsClient(TagBindingsStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final TagBindingsSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public TagBindingsStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the TagBindings for the given 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: + * + *

{@code
+   * try (TagBindingsClient tagBindingsClient = TagBindingsClient.create()) {
+   *   ResourceName parent = TagValueName.of("[TAG_VALUE]");
+   *   for (TagBinding element : tagBindingsClient.listTagBindings(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The full resource name of a resource for which you want to list + * existing TagBindings. E.g. "//cloudresourcemanager.googleapis.com/projects/123" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTagBindingsPagedResponse listTagBindings(ResourceName parent) { + ListTagBindingsRequest request = + ListTagBindingsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listTagBindings(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the TagBindings for the given 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: + * + *

{@code
+   * try (TagBindingsClient tagBindingsClient = TagBindingsClient.create()) {
+   *   String parent = TagValueName.of("[TAG_VALUE]").toString();
+   *   for (TagBinding element : tagBindingsClient.listTagBindings(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The full resource name of a resource for which you want to list + * existing TagBindings. E.g. "//cloudresourcemanager.googleapis.com/projects/123" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTagBindingsPagedResponse listTagBindings(String parent) { + ListTagBindingsRequest request = ListTagBindingsRequest.newBuilder().setParent(parent).build(); + return listTagBindings(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the TagBindings for the given 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: + * + *

{@code
+   * try (TagBindingsClient tagBindingsClient = TagBindingsClient.create()) {
+   *   ListTagBindingsRequest request =
+   *       ListTagBindingsRequest.newBuilder()
+   *           .setParent(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (TagBinding element : tagBindingsClient.listTagBindings(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTagBindingsPagedResponse listTagBindings(ListTagBindingsRequest request) { + return listTagBindingsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the TagBindings for the given 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: + * + *

{@code
+   * try (TagBindingsClient tagBindingsClient = TagBindingsClient.create()) {
+   *   ListTagBindingsRequest request =
+   *       ListTagBindingsRequest.newBuilder()
+   *           .setParent(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       tagBindingsClient.listTagBindingsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (TagBinding element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listTagBindingsPagedCallable() { + return stub.listTagBindingsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the TagBindings for the given 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: + * + *

{@code
+   * try (TagBindingsClient tagBindingsClient = TagBindingsClient.create()) {
+   *   ListTagBindingsRequest request =
+   *       ListTagBindingsRequest.newBuilder()
+   *           .setParent(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListTagBindingsResponse response =
+   *         tagBindingsClient.listTagBindingsCallable().call(request);
+   *     for (TagBinding element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listTagBindingsCallable() { + return stub.listTagBindingsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a TagBinding between a TagValue and a cloud resource (currently project, folder, or + * organization). + * + *

Sample code: + * + *

{@code
+   * try (TagBindingsClient tagBindingsClient = TagBindingsClient.create()) {
+   *   TagBinding tagBinding = TagBinding.newBuilder().build();
+   *   TagBinding response = tagBindingsClient.createTagBindingAsync(tagBinding).get();
+   * }
+   * }
+ * + * @param tagBinding Required. The TagBinding to be created. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createTagBindingAsync( + TagBinding tagBinding) { + CreateTagBindingRequest request = + CreateTagBindingRequest.newBuilder().setTagBinding(tagBinding).build(); + return createTagBindingAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a TagBinding between a TagValue and a cloud resource (currently project, folder, or + * organization). + * + *

Sample code: + * + *

{@code
+   * try (TagBindingsClient tagBindingsClient = TagBindingsClient.create()) {
+   *   CreateTagBindingRequest request =
+   *       CreateTagBindingRequest.newBuilder()
+   *           .setTagBinding(TagBinding.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   TagBinding response = tagBindingsClient.createTagBindingAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createTagBindingAsync( + CreateTagBindingRequest request) { + return createTagBindingOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a TagBinding between a TagValue and a cloud resource (currently project, folder, or + * organization). + * + *

Sample code: + * + *

{@code
+   * try (TagBindingsClient tagBindingsClient = TagBindingsClient.create()) {
+   *   CreateTagBindingRequest request =
+   *       CreateTagBindingRequest.newBuilder()
+   *           .setTagBinding(TagBinding.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       tagBindingsClient.createTagBindingOperationCallable().futureCall(request);
+   *   // Do something.
+   *   TagBinding response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createTagBindingOperationCallable() { + return stub.createTagBindingOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a TagBinding between a TagValue and a cloud resource (currently project, folder, or + * organization). + * + *

Sample code: + * + *

{@code
+   * try (TagBindingsClient tagBindingsClient = TagBindingsClient.create()) {
+   *   CreateTagBindingRequest request =
+   *       CreateTagBindingRequest.newBuilder()
+   *           .setTagBinding(TagBinding.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future =
+   *       tagBindingsClient.createTagBindingCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createTagBindingCallable() { + return stub.createTagBindingCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a TagBinding. + * + *

Sample code: + * + *

{@code
+   * try (TagBindingsClient tagBindingsClient = TagBindingsClient.create()) {
+   *   TagBindingName name = TagBindingName.of("[TAG_BINDING]");
+   *   tagBindingsClient.deleteTagBindingAsync(name).get();
+   * }
+   * }
+ * + * @param 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`). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteTagBindingAsync( + TagBindingName name) { + DeleteTagBindingRequest request = + DeleteTagBindingRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteTagBindingAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a TagBinding. + * + *

Sample code: + * + *

{@code
+   * try (TagBindingsClient tagBindingsClient = TagBindingsClient.create()) {
+   *   String name = TagBindingName.of("[TAG_BINDING]").toString();
+   *   tagBindingsClient.deleteTagBindingAsync(name).get();
+   * }
+   * }
+ * + * @param 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`). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteTagBindingAsync(String name) { + DeleteTagBindingRequest request = DeleteTagBindingRequest.newBuilder().setName(name).build(); + return deleteTagBindingAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a TagBinding. + * + *

Sample code: + * + *

{@code
+   * try (TagBindingsClient tagBindingsClient = TagBindingsClient.create()) {
+   *   DeleteTagBindingRequest request =
+   *       DeleteTagBindingRequest.newBuilder()
+   *           .setName(TagBindingName.of("[TAG_BINDING]").toString())
+   *           .build();
+   *   tagBindingsClient.deleteTagBindingAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteTagBindingAsync( + DeleteTagBindingRequest request) { + return deleteTagBindingOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a TagBinding. + * + *

Sample code: + * + *

{@code
+   * try (TagBindingsClient tagBindingsClient = TagBindingsClient.create()) {
+   *   DeleteTagBindingRequest request =
+   *       DeleteTagBindingRequest.newBuilder()
+   *           .setName(TagBindingName.of("[TAG_BINDING]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       tagBindingsClient.deleteTagBindingOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteTagBindingOperationCallable() { + return stub.deleteTagBindingOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a TagBinding. + * + *

Sample code: + * + *

{@code
+   * try (TagBindingsClient tagBindingsClient = TagBindingsClient.create()) {
+   *   DeleteTagBindingRequest request =
+   *       DeleteTagBindingRequest.newBuilder()
+   *           .setName(TagBindingName.of("[TAG_BINDING]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       tagBindingsClient.deleteTagBindingCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteTagBindingCallable() { + return stub.deleteTagBindingCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListTagBindingsPagedResponse + extends AbstractPagedListResponse< + ListTagBindingsRequest, + ListTagBindingsResponse, + TagBinding, + ListTagBindingsPage, + ListTagBindingsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListTagBindingsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListTagBindingsPagedResponse apply(ListTagBindingsPage input) { + return new ListTagBindingsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListTagBindingsPagedResponse(ListTagBindingsPage page) { + super(page, ListTagBindingsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListTagBindingsPage + extends AbstractPage< + ListTagBindingsRequest, ListTagBindingsResponse, TagBinding, ListTagBindingsPage> { + + private ListTagBindingsPage( + PageContext context, + ListTagBindingsResponse response) { + super(context, response); + } + + private static ListTagBindingsPage createEmptyPage() { + return new ListTagBindingsPage(null, null); + } + + @Override + protected ListTagBindingsPage createPage( + PageContext context, + ListTagBindingsResponse response) { + return new ListTagBindingsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListTagBindingsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListTagBindingsRequest, + ListTagBindingsResponse, + TagBinding, + ListTagBindingsPage, + ListTagBindingsFixedSizeCollection> { + + private ListTagBindingsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListTagBindingsFixedSizeCollection createEmptyCollection() { + return new ListTagBindingsFixedSizeCollection(null, 0); + } + + @Override + protected ListTagBindingsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListTagBindingsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagBindingsSettings.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagBindingsSettings.java new file mode 100644 index 000000000000..3437211db96d --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagBindingsSettings.java @@ -0,0 +1,238 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import static com.google.cloud.resourcemanager.v3.TagBindingsClient.ListTagBindingsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.resourcemanager.v3.stub.TagBindingsStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link TagBindingsClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (cloudresourcemanager.googleapis.com) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of listTagBindings to 30 seconds: + * + *

{@code
+ * TagBindingsSettings.Builder tagBindingsSettingsBuilder = TagBindingsSettings.newBuilder();
+ * tagBindingsSettingsBuilder
+ *     .listTagBindingsSettings()
+ *     .setRetrySettings(
+ *         tagBindingsSettingsBuilder
+ *             .listTagBindingsSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * TagBindingsSettings tagBindingsSettings = tagBindingsSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class TagBindingsSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listTagBindings. */ + public PagedCallSettings< + ListTagBindingsRequest, ListTagBindingsResponse, ListTagBindingsPagedResponse> + listTagBindingsSettings() { + return ((TagBindingsStubSettings) getStubSettings()).listTagBindingsSettings(); + } + + /** Returns the object with the settings used for calls to createTagBinding. */ + public UnaryCallSettings createTagBindingSettings() { + return ((TagBindingsStubSettings) getStubSettings()).createTagBindingSettings(); + } + + /** Returns the object with the settings used for calls to createTagBinding. */ + public OperationCallSettings + createTagBindingOperationSettings() { + return ((TagBindingsStubSettings) getStubSettings()).createTagBindingOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteTagBinding. */ + public UnaryCallSettings deleteTagBindingSettings() { + return ((TagBindingsStubSettings) getStubSettings()).deleteTagBindingSettings(); + } + + /** Returns the object with the settings used for calls to deleteTagBinding. */ + public OperationCallSettings + deleteTagBindingOperationSettings() { + return ((TagBindingsStubSettings) getStubSettings()).deleteTagBindingOperationSettings(); + } + + public static final TagBindingsSettings create(TagBindingsStubSettings stub) throws IOException { + return new TagBindingsSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return TagBindingsStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return TagBindingsStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return TagBindingsStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return TagBindingsStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return TagBindingsStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return TagBindingsStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return TagBindingsStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected TagBindingsSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for TagBindingsSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(TagBindingsStubSettings.newBuilder(clientContext)); + } + + protected Builder(TagBindingsSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(TagBindingsStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(TagBindingsStubSettings.newBuilder()); + } + + public TagBindingsStubSettings.Builder getStubSettingsBuilder() { + return ((TagBindingsStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listTagBindings. */ + public PagedCallSettings.Builder< + ListTagBindingsRequest, ListTagBindingsResponse, ListTagBindingsPagedResponse> + listTagBindingsSettings() { + return getStubSettingsBuilder().listTagBindingsSettings(); + } + + /** Returns the builder for the settings used for calls to createTagBinding. */ + public UnaryCallSettings.Builder + createTagBindingSettings() { + return getStubSettingsBuilder().createTagBindingSettings(); + } + + /** Returns the builder for the settings used for calls to createTagBinding. */ + public OperationCallSettings.Builder< + CreateTagBindingRequest, TagBinding, CreateTagBindingMetadata> + createTagBindingOperationSettings() { + return getStubSettingsBuilder().createTagBindingOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteTagBinding. */ + public UnaryCallSettings.Builder + deleteTagBindingSettings() { + return getStubSettingsBuilder().deleteTagBindingSettings(); + } + + /** Returns the builder for the settings used for calls to deleteTagBinding. */ + public OperationCallSettings.Builder + deleteTagBindingOperationSettings() { + return getStubSettingsBuilder().deleteTagBindingOperationSettings(); + } + + @Override + public TagBindingsSettings build() throws IOException { + return new TagBindingsSettings(this); + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagKeysClient.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagKeysClient.java new file mode 100644 index 000000000000..d4751c1ba44d --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagKeysClient.java @@ -0,0 +1,1175 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.resourcenames.ResourceName; +import com.google.cloud.resourcemanager.v3.stub.TagKeysStub; +import com.google.cloud.resourcemanager.v3.stub.TagKeysStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Allow users to create and manage tag keys. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+ *   TagKeyName name = TagKeyName.of("[TAG_KEY]");
+ *   TagKey response = tagKeysClient.getTagKey(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the TagKeysClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

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 parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of TagKeysSettings to create(). + * For example: + * + *

To customize credentials: + * + *

{@code
+ * TagKeysSettings tagKeysSettings =
+ *     TagKeysSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * TagKeysClient tagKeysClient = TagKeysClient.create(tagKeysSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * TagKeysSettings tagKeysSettings = TagKeysSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * TagKeysClient tagKeysClient = TagKeysClient.create(tagKeysSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class TagKeysClient implements BackgroundResource { + private final TagKeysSettings settings; + private final TagKeysStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of TagKeysClient with default settings. */ + public static final TagKeysClient create() throws IOException { + return create(TagKeysSettings.newBuilder().build()); + } + + /** + * Constructs an instance of TagKeysClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final TagKeysClient create(TagKeysSettings settings) throws IOException { + return new TagKeysClient(settings); + } + + /** + * Constructs an instance of TagKeysClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(TagKeysSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final TagKeysClient create(TagKeysStub stub) { + return new TagKeysClient(stub); + } + + /** + * Constructs an instance of TagKeysClient, using the given settings. This is protected so that it + * is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected TagKeysClient(TagKeysSettings settings) throws IOException { + this.settings = settings; + this.stub = ((TagKeysStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected TagKeysClient(TagKeysStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final TagKeysSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public TagKeysStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all TagKeys for a parent resource. + * + *

Sample code: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   ResourceName parent = TagValueName.of("[TAG_VALUE]");
+   *   for (TagKey element : tagKeysClient.listTagKeys(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name of the new TagKey's parent. Must be of the form + * `folders/{folder_id}` or `organizations/{org_id}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTagKeysPagedResponse listTagKeys(ResourceName parent) { + ListTagKeysRequest request = + ListTagKeysRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listTagKeys(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all TagKeys for a parent resource. + * + *

Sample code: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   String parent = TagValueName.of("[TAG_VALUE]").toString();
+   *   for (TagKey element : tagKeysClient.listTagKeys(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name of the new TagKey's parent. Must be of the form + * `folders/{folder_id}` or `organizations/{org_id}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTagKeysPagedResponse listTagKeys(String parent) { + ListTagKeysRequest request = ListTagKeysRequest.newBuilder().setParent(parent).build(); + return listTagKeys(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all TagKeys for a parent resource. + * + *

Sample code: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   ListTagKeysRequest request =
+   *       ListTagKeysRequest.newBuilder()
+   *           .setParent(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (TagKey element : tagKeysClient.listTagKeys(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTagKeysPagedResponse listTagKeys(ListTagKeysRequest request) { + return listTagKeysPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all TagKeys for a parent resource. + * + *

Sample code: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   ListTagKeysRequest request =
+   *       ListTagKeysRequest.newBuilder()
+   *           .setParent(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = tagKeysClient.listTagKeysPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (TagKey element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listTagKeysPagedCallable() { + return stub.listTagKeysPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all TagKeys for a parent resource. + * + *

Sample code: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   ListTagKeysRequest request =
+   *       ListTagKeysRequest.newBuilder()
+   *           .setParent(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListTagKeysResponse response = tagKeysClient.listTagKeysCallable().call(request);
+   *     for (TagKey element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listTagKeysCallable() { + return stub.listTagKeysCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   TagKeyName name = TagKeyName.of("[TAG_KEY]");
+   *   TagKey response = tagKeysClient.getTagKey(name);
+   * }
+   * }
+ * + * @param name Required. A resource name in the format `tagKeys/{id}`, such as `tagKeys/123`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TagKey getTagKey(TagKeyName name) { + GetTagKeyRequest request = + GetTagKeyRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getTagKey(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   String name = TagKeyName.of("[TAG_KEY]").toString();
+   *   TagKey response = tagKeysClient.getTagKey(name);
+   * }
+   * }
+ * + * @param name Required. A resource name in the format `tagKeys/{id}`, such as `tagKeys/123`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TagKey getTagKey(String name) { + GetTagKeyRequest request = GetTagKeyRequest.newBuilder().setName(name).build(); + return getTagKey(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   GetTagKeyRequest request =
+   *       GetTagKeyRequest.newBuilder().setName(TagKeyName.of("[TAG_KEY]").toString()).build();
+   *   TagKey response = tagKeysClient.getTagKey(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TagKey getTagKey(GetTagKeyRequest request) { + return getTagKeyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   GetTagKeyRequest request =
+   *       GetTagKeyRequest.newBuilder().setName(TagKeyName.of("[TAG_KEY]").toString()).build();
+   *   ApiFuture future = tagKeysClient.getTagKeyCallable().futureCall(request);
+   *   // Do something.
+   *   TagKey response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getTagKeyCallable() { + return stub.getTagKeyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 300 TagKeys can + * exist under a parent at any given time. + * + *

Sample code: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   TagKey tagKey = TagKey.newBuilder().build();
+   *   TagKey response = tagKeysClient.createTagKeyAsync(tagKey).get();
+   * }
+   * }
+ * + * @param tagKey Required. The TagKey to be created. Only fields `short_name`, `description`, and + * `parent` are considered during the creation request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createTagKeyAsync(TagKey tagKey) { + CreateTagKeyRequest request = CreateTagKeyRequest.newBuilder().setTagKey(tagKey).build(); + return createTagKeyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 300 TagKeys can + * exist under a parent at any given time. + * + *

Sample code: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   CreateTagKeyRequest request =
+   *       CreateTagKeyRequest.newBuilder()
+   *           .setTagKey(TagKey.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   TagKey response = tagKeysClient.createTagKeyAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createTagKeyAsync( + CreateTagKeyRequest request) { + return createTagKeyOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 300 TagKeys can + * exist under a parent at any given time. + * + *

Sample code: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   CreateTagKeyRequest request =
+   *       CreateTagKeyRequest.newBuilder()
+   *           .setTagKey(TagKey.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       tagKeysClient.createTagKeyOperationCallable().futureCall(request);
+   *   // Do something.
+   *   TagKey response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createTagKeyOperationCallable() { + return stub.createTagKeyOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 300 TagKeys can + * exist under a parent at any given time. + * + *

Sample code: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   CreateTagKeyRequest request =
+   *       CreateTagKeyRequest.newBuilder()
+   *           .setTagKey(TagKey.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = tagKeysClient.createTagKeyCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createTagKeyCallable() { + return stub.createTagKeyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the attributes of the TagKey resource. + * + *

Sample code: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   TagKey tagKey = TagKey.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   TagKey response = tagKeysClient.updateTagKeyAsync(tagKey, updateMask).get();
+   * }
+   * }
+ * + * @param 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, `FAILED_PRECONDITION` will be returned. + * @param 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateTagKeyAsync( + TagKey tagKey, FieldMask updateMask) { + UpdateTagKeyRequest request = + UpdateTagKeyRequest.newBuilder().setTagKey(tagKey).setUpdateMask(updateMask).build(); + return updateTagKeyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the attributes of the TagKey resource. + * + *

Sample code: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   UpdateTagKeyRequest request =
+   *       UpdateTagKeyRequest.newBuilder()
+   *           .setTagKey(TagKey.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   TagKey response = tagKeysClient.updateTagKeyAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateTagKeyAsync( + UpdateTagKeyRequest request) { + return updateTagKeyOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the attributes of the TagKey resource. + * + *

Sample code: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   UpdateTagKeyRequest request =
+   *       UpdateTagKeyRequest.newBuilder()
+   *           .setTagKey(TagKey.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       tagKeysClient.updateTagKeyOperationCallable().futureCall(request);
+   *   // Do something.
+   *   TagKey response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateTagKeyOperationCallable() { + return stub.updateTagKeyOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the attributes of the TagKey resource. + * + *

Sample code: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   UpdateTagKeyRequest request =
+   *       UpdateTagKeyRequest.newBuilder()
+   *           .setTagKey(TagKey.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = tagKeysClient.updateTagKeyCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateTagKeyCallable() { + return stub.updateTagKeyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a TagKey. The TagKey cannot be deleted if it has any child TagValues. + * + *

Sample code: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   TagKeyName name = TagKeyName.of("[TAG_KEY]");
+   *   TagKey response = tagKeysClient.deleteTagKeyAsync(name).get();
+   * }
+   * }
+ * + * @param 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteTagKeyAsync(TagKeyName name) { + DeleteTagKeyRequest request = + DeleteTagKeyRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteTagKeyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a TagKey. The TagKey cannot be deleted if it has any child TagValues. + * + *

Sample code: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   String name = TagKeyName.of("[TAG_KEY]").toString();
+   *   TagKey response = tagKeysClient.deleteTagKeyAsync(name).get();
+   * }
+   * }
+ * + * @param 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteTagKeyAsync(String name) { + DeleteTagKeyRequest request = DeleteTagKeyRequest.newBuilder().setName(name).build(); + return deleteTagKeyAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a TagKey. The TagKey cannot be deleted if it has any child TagValues. + * + *

Sample code: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   DeleteTagKeyRequest request =
+   *       DeleteTagKeyRequest.newBuilder()
+   *           .setName(TagKeyName.of("[TAG_KEY]").toString())
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   TagKey response = tagKeysClient.deleteTagKeyAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteTagKeyAsync( + DeleteTagKeyRequest request) { + return deleteTagKeyOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a TagKey. The TagKey cannot be deleted if it has any child TagValues. + * + *

Sample code: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   DeleteTagKeyRequest request =
+   *       DeleteTagKeyRequest.newBuilder()
+   *           .setName(TagKeyName.of("[TAG_KEY]").toString())
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   OperationFuture future =
+   *       tagKeysClient.deleteTagKeyOperationCallable().futureCall(request);
+   *   // Do something.
+   *   TagKey response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteTagKeyOperationCallable() { + return stub.deleteTagKeyOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a TagKey. The TagKey cannot be deleted if it has any child TagValues. + * + *

Sample code: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   DeleteTagKeyRequest request =
+   *       DeleteTagKeyRequest.newBuilder()
+   *           .setName(TagKeyName.of("[TAG_KEY]").toString())
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   ApiFuture future = tagKeysClient.deleteTagKeyCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteTagKeyCallable() { + return stub.deleteTagKeyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   ResourceName resource = TagValueName.of("[TAG_VALUE]");
+   *   Policy response = tagKeysClient.getIamPolicy(resource);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(ResourceName resource) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   String resource = TagValueName.of("[TAG_VALUE]").toString();
+   *   Policy response = tagKeysClient.getIamPolicy(resource);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(String resource) { + GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = tagKeysClient.getIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = tagKeysClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   ResourceName resource = TagValueName.of("[TAG_VALUE]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   Policy response = tagKeysClient.setIamPolicy(resource, policy);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(ResourceName resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setPolicy(policy) + .build(); + return setIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   String resource = TagValueName.of("[TAG_VALUE]").toString();
+   *   Policy policy = Policy.newBuilder().build();
+   *   Policy response = tagKeysClient.setIamPolicy(resource, policy);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(String resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); + return setIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .build();
+   *   Policy response = tagKeysClient.setIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = tagKeysClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   ResourceName resource = TagValueName.of("[TAG_VALUE]");
+   *   List permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response = tagKeysClient.testIamPermissions(resource, permissions);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param 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). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + ResourceName resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   String resource = TagValueName.of("[TAG_VALUE]").toString();
+   *   List permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response = tagKeysClient.testIamPermissions(resource, permissions);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param 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). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + String resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = tagKeysClient.testIamPermissions(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       tagKeysClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListTagKeysPagedResponse + extends AbstractPagedListResponse< + ListTagKeysRequest, + ListTagKeysResponse, + TagKey, + ListTagKeysPage, + ListTagKeysFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListTagKeysPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListTagKeysPagedResponse apply(ListTagKeysPage input) { + return new ListTagKeysPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListTagKeysPagedResponse(ListTagKeysPage page) { + super(page, ListTagKeysFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListTagKeysPage + extends AbstractPage { + + private ListTagKeysPage( + PageContext context, + ListTagKeysResponse response) { + super(context, response); + } + + private static ListTagKeysPage createEmptyPage() { + return new ListTagKeysPage(null, null); + } + + @Override + protected ListTagKeysPage createPage( + PageContext context, + ListTagKeysResponse response) { + return new ListTagKeysPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListTagKeysFixedSizeCollection + extends AbstractFixedSizeCollection< + ListTagKeysRequest, + ListTagKeysResponse, + TagKey, + ListTagKeysPage, + ListTagKeysFixedSizeCollection> { + + private ListTagKeysFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListTagKeysFixedSizeCollection createEmptyCollection() { + return new ListTagKeysFixedSizeCollection(null, 0); + } + + @Override + protected ListTagKeysFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListTagKeysFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagKeysSettings.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagKeysSettings.java new file mode 100644 index 000000000000..11027b10eaec --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagKeysSettings.java @@ -0,0 +1,302 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import static com.google.cloud.resourcemanager.v3.TagKeysClient.ListTagKeysPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.resourcemanager.v3.stub.TagKeysStubSettings; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link TagKeysClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (cloudresourcemanager.googleapis.com) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getTagKey to 30 seconds: + * + *

{@code
+ * TagKeysSettings.Builder tagKeysSettingsBuilder = TagKeysSettings.newBuilder();
+ * tagKeysSettingsBuilder
+ *     .getTagKeySettings()
+ *     .setRetrySettings(
+ *         tagKeysSettingsBuilder
+ *             .getTagKeySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * TagKeysSettings tagKeysSettings = tagKeysSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class TagKeysSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listTagKeys. */ + public PagedCallSettings + listTagKeysSettings() { + return ((TagKeysStubSettings) getStubSettings()).listTagKeysSettings(); + } + + /** Returns the object with the settings used for calls to getTagKey. */ + public UnaryCallSettings getTagKeySettings() { + return ((TagKeysStubSettings) getStubSettings()).getTagKeySettings(); + } + + /** Returns the object with the settings used for calls to createTagKey. */ + public UnaryCallSettings createTagKeySettings() { + return ((TagKeysStubSettings) getStubSettings()).createTagKeySettings(); + } + + /** Returns the object with the settings used for calls to createTagKey. */ + public OperationCallSettings + createTagKeyOperationSettings() { + return ((TagKeysStubSettings) getStubSettings()).createTagKeyOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateTagKey. */ + public UnaryCallSettings updateTagKeySettings() { + return ((TagKeysStubSettings) getStubSettings()).updateTagKeySettings(); + } + + /** Returns the object with the settings used for calls to updateTagKey. */ + public OperationCallSettings + updateTagKeyOperationSettings() { + return ((TagKeysStubSettings) getStubSettings()).updateTagKeyOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteTagKey. */ + public UnaryCallSettings deleteTagKeySettings() { + return ((TagKeysStubSettings) getStubSettings()).deleteTagKeySettings(); + } + + /** Returns the object with the settings used for calls to deleteTagKey. */ + public OperationCallSettings + deleteTagKeyOperationSettings() { + return ((TagKeysStubSettings) getStubSettings()).deleteTagKeyOperationSettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((TagKeysStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((TagKeysStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((TagKeysStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final TagKeysSettings create(TagKeysStubSettings stub) throws IOException { + return new TagKeysSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return TagKeysStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return TagKeysStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return TagKeysStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return TagKeysStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return TagKeysStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return TagKeysStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return TagKeysStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected TagKeysSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for TagKeysSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(TagKeysStubSettings.newBuilder(clientContext)); + } + + protected Builder(TagKeysSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(TagKeysStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(TagKeysStubSettings.newBuilder()); + } + + public TagKeysStubSettings.Builder getStubSettingsBuilder() { + return ((TagKeysStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listTagKeys. */ + public PagedCallSettings.Builder< + ListTagKeysRequest, ListTagKeysResponse, ListTagKeysPagedResponse> + listTagKeysSettings() { + return getStubSettingsBuilder().listTagKeysSettings(); + } + + /** Returns the builder for the settings used for calls to getTagKey. */ + public UnaryCallSettings.Builder getTagKeySettings() { + return getStubSettingsBuilder().getTagKeySettings(); + } + + /** Returns the builder for the settings used for calls to createTagKey. */ + public UnaryCallSettings.Builder createTagKeySettings() { + return getStubSettingsBuilder().createTagKeySettings(); + } + + /** Returns the builder for the settings used for calls to createTagKey. */ + public OperationCallSettings.Builder + createTagKeyOperationSettings() { + return getStubSettingsBuilder().createTagKeyOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateTagKey. */ + public UnaryCallSettings.Builder updateTagKeySettings() { + return getStubSettingsBuilder().updateTagKeySettings(); + } + + /** Returns the builder for the settings used for calls to updateTagKey. */ + public OperationCallSettings.Builder + updateTagKeyOperationSettings() { + return getStubSettingsBuilder().updateTagKeyOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteTagKey. */ + public UnaryCallSettings.Builder deleteTagKeySettings() { + return getStubSettingsBuilder().deleteTagKeySettings(); + } + + /** Returns the builder for the settings used for calls to deleteTagKey. */ + public OperationCallSettings.Builder + deleteTagKeyOperationSettings() { + return getStubSettingsBuilder().deleteTagKeyOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public TagKeysSettings build() throws IOException { + return new TagKeysSettings(this); + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagValuesClient.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagValuesClient.java new file mode 100644 index 000000000000..ad59723af83a --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagValuesClient.java @@ -0,0 +1,1186 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.resourcenames.ResourceName; +import com.google.cloud.resourcemanager.v3.stub.TagValuesStub; +import com.google.cloud.resourcemanager.v3.stub.TagValuesStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Allow users to create and manage tag values. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+ *   TagValueName name = TagValueName.of("[TAG_VALUE]");
+ *   TagValue response = tagValuesClient.getTagValue(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the TagValuesClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

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 parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of TagValuesSettings to create(). + * For example: + * + *

To customize credentials: + * + *

{@code
+ * TagValuesSettings tagValuesSettings =
+ *     TagValuesSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * TagValuesClient tagValuesClient = TagValuesClient.create(tagValuesSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * TagValuesSettings tagValuesSettings =
+ *     TagValuesSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * TagValuesClient tagValuesClient = TagValuesClient.create(tagValuesSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class TagValuesClient implements BackgroundResource { + private final TagValuesSettings settings; + private final TagValuesStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of TagValuesClient with default settings. */ + public static final TagValuesClient create() throws IOException { + return create(TagValuesSettings.newBuilder().build()); + } + + /** + * Constructs an instance of TagValuesClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final TagValuesClient create(TagValuesSettings settings) throws IOException { + return new TagValuesClient(settings); + } + + /** + * Constructs an instance of TagValuesClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(TagValuesSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final TagValuesClient create(TagValuesStub stub) { + return new TagValuesClient(stub); + } + + /** + * Constructs an instance of TagValuesClient, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected TagValuesClient(TagValuesSettings settings) throws IOException { + this.settings = settings; + this.stub = ((TagValuesStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected TagValuesClient(TagValuesStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final TagValuesSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public TagValuesStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all TagValues for a specific TagKey. + * + *

Sample code: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   ResourceName parent = TagValueName.of("[TAG_VALUE]");
+   *   for (TagValue element : tagValuesClient.listTagValues(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Resource name for TagKey, parent of the TagValues to be listed, in the + * format `tagKeys/123`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTagValuesPagedResponse listTagValues(ResourceName parent) { + ListTagValuesRequest request = + ListTagValuesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listTagValues(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all TagValues for a specific TagKey. + * + *

Sample code: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   String parent = TagValueName.of("[TAG_VALUE]").toString();
+   *   for (TagValue element : tagValuesClient.listTagValues(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Resource name for TagKey, parent of the TagValues to be listed, in the + * format `tagKeys/123`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTagValuesPagedResponse listTagValues(String parent) { + ListTagValuesRequest request = ListTagValuesRequest.newBuilder().setParent(parent).build(); + return listTagValues(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all TagValues for a specific TagKey. + * + *

Sample code: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   ListTagValuesRequest request =
+   *       ListTagValuesRequest.newBuilder()
+   *           .setParent(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (TagValue element : tagValuesClient.listTagValues(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTagValuesPagedResponse listTagValues(ListTagValuesRequest request) { + return listTagValuesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all TagValues for a specific TagKey. + * + *

Sample code: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   ListTagValuesRequest request =
+   *       ListTagValuesRequest.newBuilder()
+   *           .setParent(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = tagValuesClient.listTagValuesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (TagValue element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listTagValuesPagedCallable() { + return stub.listTagValuesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all TagValues for a specific TagKey. + * + *

Sample code: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   ListTagValuesRequest request =
+   *       ListTagValuesRequest.newBuilder()
+   *           .setParent(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListTagValuesResponse response = tagValuesClient.listTagValuesCallable().call(request);
+   *     for (TagValue element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listTagValuesCallable() { + return stub.listTagValuesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves TagValue. If the TagValue or namespaced name does not exist, or if the user does not + * have permission to view it, this method will return `PERMISSION_DENIED`. + * + *

Sample code: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   TagValueName name = TagValueName.of("[TAG_VALUE]");
+   *   TagValue response = tagValuesClient.getTagValue(name);
+   * }
+   * }
+ * + * @param name Required. Resource name for TagValue to be fetched in the format `tagValues/456`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TagValue getTagValue(TagValueName name) { + GetTagValueRequest request = + GetTagValueRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getTagValue(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves TagValue. If the TagValue or namespaced name does not exist, or if the user does not + * have permission to view it, this method will return `PERMISSION_DENIED`. + * + *

Sample code: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   String name = TagValueName.of("[TAG_VALUE]").toString();
+   *   TagValue response = tagValuesClient.getTagValue(name);
+   * }
+   * }
+ * + * @param name Required. Resource name for TagValue to be fetched in the format `tagValues/456`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TagValue getTagValue(String name) { + GetTagValueRequest request = GetTagValueRequest.newBuilder().setName(name).build(); + return getTagValue(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves TagValue. If the TagValue or namespaced name does not exist, or if the user does not + * have permission to view it, this method will return `PERMISSION_DENIED`. + * + *

Sample code: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   GetTagValueRequest request =
+   *       GetTagValueRequest.newBuilder()
+   *           .setName(TagValueName.of("[TAG_VALUE]").toString())
+   *           .build();
+   *   TagValue response = tagValuesClient.getTagValue(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TagValue getTagValue(GetTagValueRequest request) { + return getTagValueCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves TagValue. If the TagValue or namespaced name does not exist, or if the user does not + * have permission to view it, this method will return `PERMISSION_DENIED`. + * + *

Sample code: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   GetTagValueRequest request =
+   *       GetTagValueRequest.newBuilder()
+   *           .setName(TagValueName.of("[TAG_VALUE]").toString())
+   *           .build();
+   *   ApiFuture future = tagValuesClient.getTagValueCallable().futureCall(request);
+   *   // Do something.
+   *   TagValue response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getTagValueCallable() { + return stub.getTagValueCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 300 TagValues can exist under a TagKey at any given time. + * + *

Sample code: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   TagValue tagValue = TagValue.newBuilder().build();
+   *   TagValue response = tagValuesClient.createTagValueAsync(tagValue).get();
+   * }
+   * }
+ * + * @param tagValue Required. The TagValue to be created. Only fields `short_name`, `description`, + * and `parent` are considered during the creation request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createTagValueAsync( + TagValue tagValue) { + CreateTagValueRequest request = + CreateTagValueRequest.newBuilder().setTagValue(tagValue).build(); + return createTagValueAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 300 TagValues can exist under a TagKey at any given time. + * + *

Sample code: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   CreateTagValueRequest request =
+   *       CreateTagValueRequest.newBuilder()
+   *           .setTagValue(TagValue.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   TagValue response = tagValuesClient.createTagValueAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createTagValueAsync( + CreateTagValueRequest request) { + return createTagValueOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 300 TagValues can exist under a TagKey at any given time. + * + *

Sample code: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   CreateTagValueRequest request =
+   *       CreateTagValueRequest.newBuilder()
+   *           .setTagValue(TagValue.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       tagValuesClient.createTagValueOperationCallable().futureCall(request);
+   *   // Do something.
+   *   TagValue response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createTagValueOperationCallable() { + return stub.createTagValueOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 300 TagValues can exist under a TagKey at any given time. + * + *

Sample code: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   CreateTagValueRequest request =
+   *       CreateTagValueRequest.newBuilder()
+   *           .setTagValue(TagValue.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = tagValuesClient.createTagValueCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createTagValueCallable() { + return stub.createTagValueCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the attributes of the TagValue resource. + * + *

Sample code: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   TagValue tagValue = TagValue.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   TagValue response = tagValuesClient.updateTagValueAsync(tagValue, updateMask).get();
+   * }
+   * }
+ * + * @param 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, `FAILED_PRECONDITION` will + * be returned. + * @param updateMask Optional. Fields to be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateTagValueAsync( + TagValue tagValue, FieldMask updateMask) { + UpdateTagValueRequest request = + UpdateTagValueRequest.newBuilder().setTagValue(tagValue).setUpdateMask(updateMask).build(); + return updateTagValueAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the attributes of the TagValue resource. + * + *

Sample code: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   UpdateTagValueRequest request =
+   *       UpdateTagValueRequest.newBuilder()
+   *           .setTagValue(TagValue.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   TagValue response = tagValuesClient.updateTagValueAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateTagValueAsync( + UpdateTagValueRequest request) { + return updateTagValueOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the attributes of the TagValue resource. + * + *

Sample code: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   UpdateTagValueRequest request =
+   *       UpdateTagValueRequest.newBuilder()
+   *           .setTagValue(TagValue.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   OperationFuture future =
+   *       tagValuesClient.updateTagValueOperationCallable().futureCall(request);
+   *   // Do something.
+   *   TagValue response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateTagValueOperationCallable() { + return stub.updateTagValueOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the attributes of the TagValue resource. + * + *

Sample code: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   UpdateTagValueRequest request =
+   *       UpdateTagValueRequest.newBuilder()
+   *           .setTagValue(TagValue.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = tagValuesClient.updateTagValueCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateTagValueCallable() { + return stub.updateTagValueCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a TagValue. The TagValue cannot have any bindings when it is deleted. + * + *

Sample code: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   TagValueName name = TagValueName.of("[TAG_VALUE]");
+   *   TagValue response = tagValuesClient.deleteTagValueAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Resource name for TagValue to be deleted in the format tagValues/456. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteTagValueAsync( + TagValueName name) { + DeleteTagValueRequest request = + DeleteTagValueRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteTagValueAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a TagValue. The TagValue cannot have any bindings when it is deleted. + * + *

Sample code: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   String name = TagValueName.of("[TAG_VALUE]").toString();
+   *   TagValue response = tagValuesClient.deleteTagValueAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Resource name for TagValue to be deleted in the format tagValues/456. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteTagValueAsync(String name) { + DeleteTagValueRequest request = DeleteTagValueRequest.newBuilder().setName(name).build(); + return deleteTagValueAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a TagValue. The TagValue cannot have any bindings when it is deleted. + * + *

Sample code: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   DeleteTagValueRequest request =
+   *       DeleteTagValueRequest.newBuilder()
+   *           .setName(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   TagValue response = tagValuesClient.deleteTagValueAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteTagValueAsync( + DeleteTagValueRequest request) { + return deleteTagValueOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a TagValue. The TagValue cannot have any bindings when it is deleted. + * + *

Sample code: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   DeleteTagValueRequest request =
+   *       DeleteTagValueRequest.newBuilder()
+   *           .setName(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   OperationFuture future =
+   *       tagValuesClient.deleteTagValueOperationCallable().futureCall(request);
+   *   // Do something.
+   *   TagValue response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteTagValueOperationCallable() { + return stub.deleteTagValueOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a TagValue. The TagValue cannot have any bindings when it is deleted. + * + *

Sample code: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   DeleteTagValueRequest request =
+   *       DeleteTagValueRequest.newBuilder()
+   *           .setName(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setValidateOnly(true)
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   ApiFuture future = tagValuesClient.deleteTagValueCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteTagValueCallable() { + return stub.deleteTagValueCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   ResourceName resource = TagValueName.of("[TAG_VALUE]");
+   *   Policy response = tagValuesClient.getIamPolicy(resource);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(ResourceName resource) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   String resource = TagValueName.of("[TAG_VALUE]").toString();
+   *   Policy response = tagValuesClient.getIamPolicy(resource);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(String resource) { + GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = tagValuesClient.getIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = tagValuesClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   ResourceName resource = TagValueName.of("[TAG_VALUE]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   Policy response = tagValuesClient.setIamPolicy(resource, policy);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(ResourceName resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setPolicy(policy) + .build(); + return setIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   String resource = TagValueName.of("[TAG_VALUE]").toString();
+   *   Policy policy = Policy.newBuilder().build();
+   *   Policy response = tagValuesClient.setIamPolicy(resource, policy);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(String resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); + return setIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .build();
+   *   Policy response = tagValuesClient.setIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = tagValuesClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   ResourceName resource = TagValueName.of("[TAG_VALUE]");
+   *   List permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response =
+   *       tagValuesClient.testIamPermissions(resource, permissions);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param 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). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + ResourceName resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   String resource = TagValueName.of("[TAG_VALUE]").toString();
+   *   List permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response =
+   *       tagValuesClient.testIamPermissions(resource, permissions);
+   * }
+   * }
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param 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). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + String resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = tagValuesClient.testIamPermissions(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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: + * + *

{@code
+   * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(TagValueName.of("[TAG_VALUE]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       tagValuesClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListTagValuesPagedResponse + extends AbstractPagedListResponse< + ListTagValuesRequest, + ListTagValuesResponse, + TagValue, + ListTagValuesPage, + ListTagValuesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListTagValuesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListTagValuesPagedResponse apply(ListTagValuesPage input) { + return new ListTagValuesPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListTagValuesPagedResponse(ListTagValuesPage page) { + super(page, ListTagValuesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListTagValuesPage + extends AbstractPage< + ListTagValuesRequest, ListTagValuesResponse, TagValue, ListTagValuesPage> { + + private ListTagValuesPage( + PageContext context, + ListTagValuesResponse response) { + super(context, response); + } + + private static ListTagValuesPage createEmptyPage() { + return new ListTagValuesPage(null, null); + } + + @Override + protected ListTagValuesPage createPage( + PageContext context, + ListTagValuesResponse response) { + return new ListTagValuesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListTagValuesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListTagValuesRequest, + ListTagValuesResponse, + TagValue, + ListTagValuesPage, + ListTagValuesFixedSizeCollection> { + + private ListTagValuesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListTagValuesFixedSizeCollection createEmptyCollection() { + return new ListTagValuesFixedSizeCollection(null, 0); + } + + @Override + protected ListTagValuesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListTagValuesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagValuesSettings.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagValuesSettings.java new file mode 100644 index 000000000000..172ae24ae396 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagValuesSettings.java @@ -0,0 +1,302 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import static com.google.cloud.resourcemanager.v3.TagValuesClient.ListTagValuesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.resourcemanager.v3.stub.TagValuesStubSettings; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link TagValuesClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (cloudresourcemanager.googleapis.com) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getTagValue to 30 seconds: + * + *

{@code
+ * TagValuesSettings.Builder tagValuesSettingsBuilder = TagValuesSettings.newBuilder();
+ * tagValuesSettingsBuilder
+ *     .getTagValueSettings()
+ *     .setRetrySettings(
+ *         tagValuesSettingsBuilder
+ *             .getTagValueSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * TagValuesSettings tagValuesSettings = tagValuesSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class TagValuesSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listTagValues. */ + public PagedCallSettings + listTagValuesSettings() { + return ((TagValuesStubSettings) getStubSettings()).listTagValuesSettings(); + } + + /** Returns the object with the settings used for calls to getTagValue. */ + public UnaryCallSettings getTagValueSettings() { + return ((TagValuesStubSettings) getStubSettings()).getTagValueSettings(); + } + + /** Returns the object with the settings used for calls to createTagValue. */ + public UnaryCallSettings createTagValueSettings() { + return ((TagValuesStubSettings) getStubSettings()).createTagValueSettings(); + } + + /** Returns the object with the settings used for calls to createTagValue. */ + public OperationCallSettings + createTagValueOperationSettings() { + return ((TagValuesStubSettings) getStubSettings()).createTagValueOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateTagValue. */ + public UnaryCallSettings updateTagValueSettings() { + return ((TagValuesStubSettings) getStubSettings()).updateTagValueSettings(); + } + + /** Returns the object with the settings used for calls to updateTagValue. */ + public OperationCallSettings + updateTagValueOperationSettings() { + return ((TagValuesStubSettings) getStubSettings()).updateTagValueOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteTagValue. */ + public UnaryCallSettings deleteTagValueSettings() { + return ((TagValuesStubSettings) getStubSettings()).deleteTagValueSettings(); + } + + /** Returns the object with the settings used for calls to deleteTagValue. */ + public OperationCallSettings + deleteTagValueOperationSettings() { + return ((TagValuesStubSettings) getStubSettings()).deleteTagValueOperationSettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((TagValuesStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((TagValuesStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((TagValuesStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final TagValuesSettings create(TagValuesStubSettings stub) throws IOException { + return new TagValuesSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return TagValuesStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return TagValuesStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return TagValuesStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return TagValuesStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return TagValuesStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return TagValuesStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return TagValuesStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected TagValuesSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for TagValuesSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(TagValuesStubSettings.newBuilder(clientContext)); + } + + protected Builder(TagValuesSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(TagValuesStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(TagValuesStubSettings.newBuilder()); + } + + public TagValuesStubSettings.Builder getStubSettingsBuilder() { + return ((TagValuesStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listTagValues. */ + public PagedCallSettings.Builder< + ListTagValuesRequest, ListTagValuesResponse, ListTagValuesPagedResponse> + listTagValuesSettings() { + return getStubSettingsBuilder().listTagValuesSettings(); + } + + /** Returns the builder for the settings used for calls to getTagValue. */ + public UnaryCallSettings.Builder getTagValueSettings() { + return getStubSettingsBuilder().getTagValueSettings(); + } + + /** Returns the builder for the settings used for calls to createTagValue. */ + public UnaryCallSettings.Builder createTagValueSettings() { + return getStubSettingsBuilder().createTagValueSettings(); + } + + /** Returns the builder for the settings used for calls to createTagValue. */ + public OperationCallSettings.Builder + createTagValueOperationSettings() { + return getStubSettingsBuilder().createTagValueOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateTagValue. */ + public UnaryCallSettings.Builder updateTagValueSettings() { + return getStubSettingsBuilder().updateTagValueSettings(); + } + + /** Returns the builder for the settings used for calls to updateTagValue. */ + public OperationCallSettings.Builder + updateTagValueOperationSettings() { + return getStubSettingsBuilder().updateTagValueOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteTagValue. */ + public UnaryCallSettings.Builder deleteTagValueSettings() { + return getStubSettingsBuilder().deleteTagValueSettings(); + } + + /** Returns the builder for the settings used for calls to deleteTagValue. */ + public OperationCallSettings.Builder + deleteTagValueOperationSettings() { + return getStubSettingsBuilder().deleteTagValueOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public TagValuesSettings build() throws IOException { + return new TagValuesSettings(this); + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/gapic_metadata.json b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/gapic_metadata.json new file mode 100644 index 000000000000..87f00f3eda12 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/gapic_metadata.json @@ -0,0 +1,201 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.resourcemanager.v3", + "libraryPackage": "com.google.cloud.resourcemanager.v3", + "services": { + "Folders": { + "clients": { + "grpc": { + "libraryClient": "FoldersClient", + "rpcs": { + "CreateFolder": { + "methods": ["createFolderAsync", "createFolderAsync", "createFolderOperationCallable", "createFolderCallable"] + }, + "DeleteFolder": { + "methods": ["deleteFolderAsync", "deleteFolderAsync", "deleteFolderAsync", "deleteFolderOperationCallable", "deleteFolderCallable"] + }, + "GetFolder": { + "methods": ["getFolder", "getFolder", "getFolder", "getFolderCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicy", "getIamPolicy", "getIamPolicyCallable"] + }, + "ListFolders": { + "methods": ["listFolders", "listFolders", "listFolders", "listFoldersPagedCallable", "listFoldersCallable"] + }, + "MoveFolder": { + "methods": ["moveFolderAsync", "moveFolderAsync", "moveFolderAsync", "moveFolderAsync", "moveFolderAsync", "moveFolderOperationCallable", "moveFolderCallable"] + }, + "SearchFolders": { + "methods": ["searchFolders", "searchFolders", "searchFoldersPagedCallable", "searchFoldersCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicy", "setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissions", "testIamPermissions", "testIamPermissionsCallable"] + }, + "UndeleteFolder": { + "methods": ["undeleteFolderAsync", "undeleteFolderAsync", "undeleteFolderAsync", "undeleteFolderOperationCallable", "undeleteFolderCallable"] + }, + "UpdateFolder": { + "methods": ["updateFolderAsync", "updateFolderAsync", "updateFolderOperationCallable", "updateFolderCallable"] + } + } + } + } + }, + "Organizations": { + "clients": { + "grpc": { + "libraryClient": "OrganizationsClient", + "rpcs": { + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicy", "getIamPolicy", "getIamPolicyCallable"] + }, + "GetOrganization": { + "methods": ["getOrganization", "getOrganization", "getOrganization", "getOrganizationCallable"] + }, + "SearchOrganizations": { + "methods": ["searchOrganizations", "searchOrganizations", "searchOrganizationsPagedCallable", "searchOrganizationsCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicy", "setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissions", "testIamPermissions", "testIamPermissionsCallable"] + } + } + } + } + }, + "Projects": { + "clients": { + "grpc": { + "libraryClient": "ProjectsClient", + "rpcs": { + "CreateProject": { + "methods": ["createProjectAsync", "createProjectAsync", "createProjectOperationCallable", "createProjectCallable"] + }, + "DeleteProject": { + "methods": ["deleteProjectAsync", "deleteProjectAsync", "deleteProjectAsync", "deleteProjectOperationCallable", "deleteProjectCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicy", "getIamPolicy", "getIamPolicyCallable"] + }, + "GetProject": { + "methods": ["getProject", "getProject", "getProject", "getProjectCallable"] + }, + "ListProjects": { + "methods": ["listProjects", "listProjects", "listProjects", "listProjectsPagedCallable", "listProjectsCallable"] + }, + "MoveProject": { + "methods": ["moveProjectAsync", "moveProjectAsync", "moveProjectAsync", "moveProjectAsync", "moveProjectAsync", "moveProjectOperationCallable", "moveProjectCallable"] + }, + "SearchProjects": { + "methods": ["searchProjects", "searchProjects", "searchProjectsPagedCallable", "searchProjectsCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicy", "setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissions", "testIamPermissions", "testIamPermissionsCallable"] + }, + "UndeleteProject": { + "methods": ["undeleteProjectAsync", "undeleteProjectAsync", "undeleteProjectAsync", "undeleteProjectOperationCallable", "undeleteProjectCallable"] + }, + "UpdateProject": { + "methods": ["updateProjectAsync", "updateProjectAsync", "updateProjectOperationCallable", "updateProjectCallable"] + } + } + } + } + }, + "TagBindings": { + "clients": { + "grpc": { + "libraryClient": "TagBindingsClient", + "rpcs": { + "CreateTagBinding": { + "methods": ["createTagBindingAsync", "createTagBindingAsync", "createTagBindingOperationCallable", "createTagBindingCallable"] + }, + "DeleteTagBinding": { + "methods": ["deleteTagBindingAsync", "deleteTagBindingAsync", "deleteTagBindingAsync", "deleteTagBindingOperationCallable", "deleteTagBindingCallable"] + }, + "ListTagBindings": { + "methods": ["listTagBindings", "listTagBindings", "listTagBindings", "listTagBindingsPagedCallable", "listTagBindingsCallable"] + } + } + } + } + }, + "TagKeys": { + "clients": { + "grpc": { + "libraryClient": "TagKeysClient", + "rpcs": { + "CreateTagKey": { + "methods": ["createTagKeyAsync", "createTagKeyAsync", "createTagKeyOperationCallable", "createTagKeyCallable"] + }, + "DeleteTagKey": { + "methods": ["deleteTagKeyAsync", "deleteTagKeyAsync", "deleteTagKeyAsync", "deleteTagKeyOperationCallable", "deleteTagKeyCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicy", "getIamPolicy", "getIamPolicyCallable"] + }, + "GetTagKey": { + "methods": ["getTagKey", "getTagKey", "getTagKey", "getTagKeyCallable"] + }, + "ListTagKeys": { + "methods": ["listTagKeys", "listTagKeys", "listTagKeys", "listTagKeysPagedCallable", "listTagKeysCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicy", "setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissions", "testIamPermissions", "testIamPermissionsCallable"] + }, + "UpdateTagKey": { + "methods": ["updateTagKeyAsync", "updateTagKeyAsync", "updateTagKeyOperationCallable", "updateTagKeyCallable"] + } + } + } + } + }, + "TagValues": { + "clients": { + "grpc": { + "libraryClient": "TagValuesClient", + "rpcs": { + "CreateTagValue": { + "methods": ["createTagValueAsync", "createTagValueAsync", "createTagValueOperationCallable", "createTagValueCallable"] + }, + "DeleteTagValue": { + "methods": ["deleteTagValueAsync", "deleteTagValueAsync", "deleteTagValueAsync", "deleteTagValueOperationCallable", "deleteTagValueCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicy", "getIamPolicy", "getIamPolicyCallable"] + }, + "GetTagValue": { + "methods": ["getTagValue", "getTagValue", "getTagValue", "getTagValueCallable"] + }, + "ListTagValues": { + "methods": ["listTagValues", "listTagValues", "listTagValues", "listTagValuesPagedCallable", "listTagValuesCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicy", "setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissions", "testIamPermissions", "testIamPermissionsCallable"] + }, + "UpdateTagValue": { + "methods": ["updateTagValueAsync", "updateTagValueAsync", "updateTagValueOperationCallable", "updateTagValueCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/package-info.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/package-info.java new file mode 100644 index 000000000000..2162f0b65b7c --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/package-info.java @@ -0,0 +1,105 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * The interfaces provided are listed below, along with usage samples. + * + *

======================= FoldersClient ======================= + * + *

Service Description: Manages Cloud Platform folder resources. Folders can be used to organize + * the resources under an organization and to control the policies applied to groups of resources. + * + *

Sample for FoldersClient: + * + *

{@code
+ * try (FoldersClient foldersClient = FoldersClient.create()) {
+ *   FolderName name = FolderName.of("[FOLDER]");
+ *   Folder response = foldersClient.getFolder(name);
+ * }
+ * }
+ * + *

======================= OrganizationsClient ======================= + * + *

Service Description: Allows users to manage their organization resources. + * + *

Sample for OrganizationsClient: + * + *

{@code
+ * try (OrganizationsClient organizationsClient = OrganizationsClient.create()) {
+ *   OrganizationName name = OrganizationName.of("[ORGANIZATION]");
+ *   Organization response = organizationsClient.getOrganization(name);
+ * }
+ * }
+ * + *

======================= ProjectsClient ======================= + * + *

Service Description: Manages Google Cloud Projects. + * + *

Sample for ProjectsClient: + * + *

{@code
+ * try (ProjectsClient projectsClient = ProjectsClient.create()) {
+ *   ProjectName name = ProjectName.of("[PROJECT]");
+ *   Project response = projectsClient.getProject(name);
+ * }
+ * }
+ * + *

======================= TagBindingsClient ======================= + * + *

Service Description: Allow users to create and manage TagBindings between TagValues and + * different cloud resources throughout the GCP resource hierarchy. + * + *

Sample for TagBindingsClient: + * + *

{@code
+ * try (TagBindingsClient tagBindingsClient = TagBindingsClient.create()) {
+ *   ResourceName parent = TagValueName.of("[TAG_VALUE]");
+ *   for (TagBinding element : tagBindingsClient.listTagBindings(parent).iterateAll()) {
+ *     // doThingsWith(element);
+ *   }
+ * }
+ * }
+ * + *

======================= TagKeysClient ======================= + * + *

Service Description: Allow users to create and manage tag keys. + * + *

Sample for TagKeysClient: + * + *

{@code
+ * try (TagKeysClient tagKeysClient = TagKeysClient.create()) {
+ *   TagKeyName name = TagKeyName.of("[TAG_KEY]");
+ *   TagKey response = tagKeysClient.getTagKey(name);
+ * }
+ * }
+ * + *

======================= TagValuesClient ======================= + * + *

Service Description: Allow users to create and manage tag values. + * + *

Sample for TagValuesClient: + * + *

{@code
+ * try (TagValuesClient tagValuesClient = TagValuesClient.create()) {
+ *   TagValueName name = TagValueName.of("[TAG_VALUE]");
+ *   TagValue response = tagValuesClient.getTagValue(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.resourcemanager.v3; + +import javax.annotation.Generated; diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/FoldersStub.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/FoldersStub.java new file mode 100644 index 000000000000..57c0a54bb44d --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/FoldersStub.java @@ -0,0 +1,144 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3.stub; + +import static com.google.cloud.resourcemanager.v3.FoldersClient.ListFoldersPagedResponse; +import static com.google.cloud.resourcemanager.v3.FoldersClient.SearchFoldersPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.resourcemanager.v3.CreateFolderMetadata; +import com.google.cloud.resourcemanager.v3.CreateFolderRequest; +import com.google.cloud.resourcemanager.v3.DeleteFolderMetadata; +import com.google.cloud.resourcemanager.v3.DeleteFolderRequest; +import com.google.cloud.resourcemanager.v3.Folder; +import com.google.cloud.resourcemanager.v3.GetFolderRequest; +import com.google.cloud.resourcemanager.v3.ListFoldersRequest; +import com.google.cloud.resourcemanager.v3.ListFoldersResponse; +import com.google.cloud.resourcemanager.v3.MoveFolderMetadata; +import com.google.cloud.resourcemanager.v3.MoveFolderRequest; +import com.google.cloud.resourcemanager.v3.SearchFoldersRequest; +import com.google.cloud.resourcemanager.v3.SearchFoldersResponse; +import com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata; +import com.google.cloud.resourcemanager.v3.UndeleteFolderRequest; +import com.google.cloud.resourcemanager.v3.UpdateFolderMetadata; +import com.google.cloud.resourcemanager.v3.UpdateFolderRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Folders service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class FoldersStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable getFolderCallable() { + throw new UnsupportedOperationException("Not implemented: getFolderCallable()"); + } + + public UnaryCallable listFoldersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listFoldersPagedCallable()"); + } + + public UnaryCallable listFoldersCallable() { + throw new UnsupportedOperationException("Not implemented: listFoldersCallable()"); + } + + public UnaryCallable + searchFoldersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: searchFoldersPagedCallable()"); + } + + public UnaryCallable searchFoldersCallable() { + throw new UnsupportedOperationException("Not implemented: searchFoldersCallable()"); + } + + public OperationCallable + createFolderOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createFolderOperationCallable()"); + } + + public UnaryCallable createFolderCallable() { + throw new UnsupportedOperationException("Not implemented: createFolderCallable()"); + } + + public OperationCallable + updateFolderOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateFolderOperationCallable()"); + } + + public UnaryCallable updateFolderCallable() { + throw new UnsupportedOperationException("Not implemented: updateFolderCallable()"); + } + + public OperationCallable + moveFolderOperationCallable() { + throw new UnsupportedOperationException("Not implemented: moveFolderOperationCallable()"); + } + + public UnaryCallable moveFolderCallable() { + throw new UnsupportedOperationException("Not implemented: moveFolderCallable()"); + } + + public OperationCallable + deleteFolderOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteFolderOperationCallable()"); + } + + public UnaryCallable deleteFolderCallable() { + throw new UnsupportedOperationException("Not implemented: deleteFolderCallable()"); + } + + public OperationCallable + undeleteFolderOperationCallable() { + throw new UnsupportedOperationException("Not implemented: undeleteFolderOperationCallable()"); + } + + public UnaryCallable undeleteFolderCallable() { + throw new UnsupportedOperationException("Not implemented: undeleteFolderCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/FoldersStubSettings.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/FoldersStubSettings.java new file mode 100644 index 000000000000..8070795c272d --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/FoldersStubSettings.java @@ -0,0 +1,886 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3.stub; + +import static com.google.cloud.resourcemanager.v3.FoldersClient.ListFoldersPagedResponse; +import static com.google.cloud.resourcemanager.v3.FoldersClient.SearchFoldersPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.resourcemanager.v3.CreateFolderMetadata; +import com.google.cloud.resourcemanager.v3.CreateFolderRequest; +import com.google.cloud.resourcemanager.v3.DeleteFolderMetadata; +import com.google.cloud.resourcemanager.v3.DeleteFolderRequest; +import com.google.cloud.resourcemanager.v3.Folder; +import com.google.cloud.resourcemanager.v3.GetFolderRequest; +import com.google.cloud.resourcemanager.v3.ListFoldersRequest; +import com.google.cloud.resourcemanager.v3.ListFoldersResponse; +import com.google.cloud.resourcemanager.v3.MoveFolderMetadata; +import com.google.cloud.resourcemanager.v3.MoveFolderRequest; +import com.google.cloud.resourcemanager.v3.SearchFoldersRequest; +import com.google.cloud.resourcemanager.v3.SearchFoldersResponse; +import com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata; +import com.google.cloud.resourcemanager.v3.UndeleteFolderRequest; +import com.google.cloud.resourcemanager.v3.UpdateFolderMetadata; +import com.google.cloud.resourcemanager.v3.UpdateFolderRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link FoldersStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (cloudresourcemanager.googleapis.com) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getFolder to 30 seconds: + * + *

{@code
+ * FoldersStubSettings.Builder foldersSettingsBuilder = FoldersStubSettings.newBuilder();
+ * foldersSettingsBuilder
+ *     .getFolderSettings()
+ *     .setRetrySettings(
+ *         foldersSettingsBuilder
+ *             .getFolderSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * FoldersStubSettings foldersSettings = foldersSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class FoldersStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/cloud-platform.read-only") + .build(); + + private final UnaryCallSettings getFolderSettings; + private final PagedCallSettings + listFoldersSettings; + private final PagedCallSettings< + SearchFoldersRequest, SearchFoldersResponse, SearchFoldersPagedResponse> + searchFoldersSettings; + private final UnaryCallSettings createFolderSettings; + private final OperationCallSettings + createFolderOperationSettings; + private final UnaryCallSettings updateFolderSettings; + private final OperationCallSettings + updateFolderOperationSettings; + private final UnaryCallSettings moveFolderSettings; + private final OperationCallSettings + moveFolderOperationSettings; + private final UnaryCallSettings deleteFolderSettings; + private final OperationCallSettings + deleteFolderOperationSettings; + private final UnaryCallSettings undeleteFolderSettings; + private final OperationCallSettings + undeleteFolderOperationSettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_FOLDERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListFoldersRequest injectToken(ListFoldersRequest payload, String token) { + return ListFoldersRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListFoldersRequest injectPageSize(ListFoldersRequest payload, int pageSize) { + return ListFoldersRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListFoldersRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListFoldersResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListFoldersResponse payload) { + return payload.getFoldersList() == null + ? ImmutableList.of() + : payload.getFoldersList(); + } + }; + + private static final PagedListDescriptor + SEARCH_FOLDERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public SearchFoldersRequest injectToken(SearchFoldersRequest payload, String token) { + return SearchFoldersRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public SearchFoldersRequest injectPageSize(SearchFoldersRequest payload, int pageSize) { + return SearchFoldersRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(SearchFoldersRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(SearchFoldersResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(SearchFoldersResponse payload) { + return payload.getFoldersList() == null + ? ImmutableList.of() + : payload.getFoldersList(); + } + }; + + private static final PagedListResponseFactory< + ListFoldersRequest, ListFoldersResponse, ListFoldersPagedResponse> + LIST_FOLDERS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListFoldersRequest, ListFoldersResponse, ListFoldersPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListFoldersRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_FOLDERS_PAGE_STR_DESC, request, context); + return ListFoldersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + SearchFoldersRequest, SearchFoldersResponse, SearchFoldersPagedResponse> + SEARCH_FOLDERS_PAGE_STR_FACT = + new PagedListResponseFactory< + SearchFoldersRequest, SearchFoldersResponse, SearchFoldersPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + SearchFoldersRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, SEARCH_FOLDERS_PAGE_STR_DESC, request, context); + return SearchFoldersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to getFolder. */ + public UnaryCallSettings getFolderSettings() { + return getFolderSettings; + } + + /** Returns the object with the settings used for calls to listFolders. */ + public PagedCallSettings + listFoldersSettings() { + return listFoldersSettings; + } + + /** Returns the object with the settings used for calls to searchFolders. */ + public PagedCallSettings + searchFoldersSettings() { + return searchFoldersSettings; + } + + /** Returns the object with the settings used for calls to createFolder. */ + public UnaryCallSettings createFolderSettings() { + return createFolderSettings; + } + + /** Returns the object with the settings used for calls to createFolder. */ + public OperationCallSettings + createFolderOperationSettings() { + return createFolderOperationSettings; + } + + /** Returns the object with the settings used for calls to updateFolder. */ + public UnaryCallSettings updateFolderSettings() { + return updateFolderSettings; + } + + /** Returns the object with the settings used for calls to updateFolder. */ + public OperationCallSettings + updateFolderOperationSettings() { + return updateFolderOperationSettings; + } + + /** Returns the object with the settings used for calls to moveFolder. */ + public UnaryCallSettings moveFolderSettings() { + return moveFolderSettings; + } + + /** Returns the object with the settings used for calls to moveFolder. */ + public OperationCallSettings + moveFolderOperationSettings() { + return moveFolderOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteFolder. */ + public UnaryCallSettings deleteFolderSettings() { + return deleteFolderSettings; + } + + /** Returns the object with the settings used for calls to deleteFolder. */ + public OperationCallSettings + deleteFolderOperationSettings() { + return deleteFolderOperationSettings; + } + + /** Returns the object with the settings used for calls to undeleteFolder. */ + public UnaryCallSettings undeleteFolderSettings() { + return undeleteFolderSettings; + } + + /** Returns the object with the settings used for calls to undeleteFolder. */ + public OperationCallSettings + undeleteFolderOperationSettings() { + return undeleteFolderOperationSettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public FoldersStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcFoldersStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "cloudresourcemanager.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(FoldersStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected FoldersStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getFolderSettings = settingsBuilder.getFolderSettings().build(); + listFoldersSettings = settingsBuilder.listFoldersSettings().build(); + searchFoldersSettings = settingsBuilder.searchFoldersSettings().build(); + createFolderSettings = settingsBuilder.createFolderSettings().build(); + createFolderOperationSettings = settingsBuilder.createFolderOperationSettings().build(); + updateFolderSettings = settingsBuilder.updateFolderSettings().build(); + updateFolderOperationSettings = settingsBuilder.updateFolderOperationSettings().build(); + moveFolderSettings = settingsBuilder.moveFolderSettings().build(); + moveFolderOperationSettings = settingsBuilder.moveFolderOperationSettings().build(); + deleteFolderSettings = settingsBuilder.deleteFolderSettings().build(); + deleteFolderOperationSettings = settingsBuilder.deleteFolderOperationSettings().build(); + undeleteFolderSettings = settingsBuilder.undeleteFolderSettings().build(); + undeleteFolderOperationSettings = settingsBuilder.undeleteFolderOperationSettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for FoldersStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder getFolderSettings; + private final PagedCallSettings.Builder< + ListFoldersRequest, ListFoldersResponse, ListFoldersPagedResponse> + listFoldersSettings; + private final PagedCallSettings.Builder< + SearchFoldersRequest, SearchFoldersResponse, SearchFoldersPagedResponse> + searchFoldersSettings; + private final UnaryCallSettings.Builder createFolderSettings; + private final OperationCallSettings.Builder + createFolderOperationSettings; + private final UnaryCallSettings.Builder updateFolderSettings; + private final OperationCallSettings.Builder + updateFolderOperationSettings; + private final UnaryCallSettings.Builder moveFolderSettings; + private final OperationCallSettings.Builder + moveFolderOperationSettings; + private final UnaryCallSettings.Builder deleteFolderSettings; + private final OperationCallSettings.Builder + deleteFolderOperationSettings; + private final UnaryCallSettings.Builder + undeleteFolderSettings; + private final OperationCallSettings.Builder< + UndeleteFolderRequest, Folder, UndeleteFolderMetadata> + undeleteFolderOperationSettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_1_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getFolderSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listFoldersSettings = PagedCallSettings.newBuilder(LIST_FOLDERS_PAGE_STR_FACT); + searchFoldersSettings = PagedCallSettings.newBuilder(SEARCH_FOLDERS_PAGE_STR_FACT); + createFolderSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createFolderOperationSettings = OperationCallSettings.newBuilder(); + updateFolderSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateFolderOperationSettings = OperationCallSettings.newBuilder(); + moveFolderSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + moveFolderOperationSettings = OperationCallSettings.newBuilder(); + deleteFolderSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteFolderOperationSettings = OperationCallSettings.newBuilder(); + undeleteFolderSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + undeleteFolderOperationSettings = OperationCallSettings.newBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getFolderSettings, + listFoldersSettings, + searchFoldersSettings, + createFolderSettings, + updateFolderSettings, + moveFolderSettings, + deleteFolderSettings, + undeleteFolderSettings, + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(FoldersStubSettings settings) { + super(settings); + + getFolderSettings = settings.getFolderSettings.toBuilder(); + listFoldersSettings = settings.listFoldersSettings.toBuilder(); + searchFoldersSettings = settings.searchFoldersSettings.toBuilder(); + createFolderSettings = settings.createFolderSettings.toBuilder(); + createFolderOperationSettings = settings.createFolderOperationSettings.toBuilder(); + updateFolderSettings = settings.updateFolderSettings.toBuilder(); + updateFolderOperationSettings = settings.updateFolderOperationSettings.toBuilder(); + moveFolderSettings = settings.moveFolderSettings.toBuilder(); + moveFolderOperationSettings = settings.moveFolderOperationSettings.toBuilder(); + deleteFolderSettings = settings.deleteFolderSettings.toBuilder(); + deleteFolderOperationSettings = settings.deleteFolderOperationSettings.toBuilder(); + undeleteFolderSettings = settings.undeleteFolderSettings.toBuilder(); + undeleteFolderOperationSettings = settings.undeleteFolderOperationSettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getFolderSettings, + listFoldersSettings, + searchFoldersSettings, + createFolderSettings, + updateFolderSettings, + moveFolderSettings, + deleteFolderSettings, + undeleteFolderSettings, + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .getFolderSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listFoldersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .searchFoldersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .createFolderSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateFolderSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .moveFolderSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteFolderSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .undeleteFolderSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createFolderOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Folder.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(CreateFolderMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateFolderOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Folder.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(UpdateFolderMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .moveFolderOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Folder.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(MoveFolderMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteFolderOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Folder.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(DeleteFolderMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .undeleteFolderOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Folder.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(UndeleteFolderMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to getFolder. */ + public UnaryCallSettings.Builder getFolderSettings() { + return getFolderSettings; + } + + /** Returns the builder for the settings used for calls to listFolders. */ + public PagedCallSettings.Builder< + ListFoldersRequest, ListFoldersResponse, ListFoldersPagedResponse> + listFoldersSettings() { + return listFoldersSettings; + } + + /** Returns the builder for the settings used for calls to searchFolders. */ + public PagedCallSettings.Builder< + SearchFoldersRequest, SearchFoldersResponse, SearchFoldersPagedResponse> + searchFoldersSettings() { + return searchFoldersSettings; + } + + /** Returns the builder for the settings used for calls to createFolder. */ + public UnaryCallSettings.Builder createFolderSettings() { + return createFolderSettings; + } + + /** Returns the builder for the settings used for calls to createFolder. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createFolderOperationSettings() { + return createFolderOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateFolder. */ + public UnaryCallSettings.Builder updateFolderSettings() { + return updateFolderSettings; + } + + /** Returns the builder for the settings used for calls to updateFolder. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateFolderOperationSettings() { + return updateFolderOperationSettings; + } + + /** Returns the builder for the settings used for calls to moveFolder. */ + public UnaryCallSettings.Builder moveFolderSettings() { + return moveFolderSettings; + } + + /** Returns the builder for the settings used for calls to moveFolder. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + moveFolderOperationSettings() { + return moveFolderOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteFolder. */ + public UnaryCallSettings.Builder deleteFolderSettings() { + return deleteFolderSettings; + } + + /** Returns the builder for the settings used for calls to deleteFolder. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteFolderOperationSettings() { + return deleteFolderOperationSettings; + } + + /** Returns the builder for the settings used for calls to undeleteFolder. */ + public UnaryCallSettings.Builder undeleteFolderSettings() { + return undeleteFolderSettings; + } + + /** Returns the builder for the settings used for calls to undeleteFolder. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + undeleteFolderOperationSettings() { + return undeleteFolderOperationSettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public FoldersStubSettings build() throws IOException { + return new FoldersStubSettings(this); + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcFoldersCallableFactory.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcFoldersCallableFactory.java new file mode 100644 index 000000000000..36ece8bc6787 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcFoldersCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Folders service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcFoldersCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcFoldersStub.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcFoldersStub.java new file mode 100644 index 000000000000..f4afd24c542e --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcFoldersStub.java @@ -0,0 +1,560 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3.stub; + +import static com.google.cloud.resourcemanager.v3.FoldersClient.ListFoldersPagedResponse; +import static com.google.cloud.resourcemanager.v3.FoldersClient.SearchFoldersPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.resourcemanager.v3.CreateFolderMetadata; +import com.google.cloud.resourcemanager.v3.CreateFolderRequest; +import com.google.cloud.resourcemanager.v3.DeleteFolderMetadata; +import com.google.cloud.resourcemanager.v3.DeleteFolderRequest; +import com.google.cloud.resourcemanager.v3.Folder; +import com.google.cloud.resourcemanager.v3.GetFolderRequest; +import com.google.cloud.resourcemanager.v3.ListFoldersRequest; +import com.google.cloud.resourcemanager.v3.ListFoldersResponse; +import com.google.cloud.resourcemanager.v3.MoveFolderMetadata; +import com.google.cloud.resourcemanager.v3.MoveFolderRequest; +import com.google.cloud.resourcemanager.v3.SearchFoldersRequest; +import com.google.cloud.resourcemanager.v3.SearchFoldersResponse; +import com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata; +import com.google.cloud.resourcemanager.v3.UndeleteFolderRequest; +import com.google.cloud.resourcemanager.v3.UpdateFolderMetadata; +import com.google.cloud.resourcemanager.v3.UpdateFolderRequest; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the Folders service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcFoldersStub extends FoldersStub { + private static final MethodDescriptor getFolderMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Folders/GetFolder") + .setRequestMarshaller(ProtoUtils.marshaller(GetFolderRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Folder.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listFoldersMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Folders/ListFolders") + .setRequestMarshaller(ProtoUtils.marshaller(ListFoldersRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListFoldersResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + searchFoldersMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Folders/SearchFolders") + .setRequestMarshaller( + ProtoUtils.marshaller(SearchFoldersRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SearchFoldersResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createFolderMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Folders/CreateFolder") + .setRequestMarshaller(ProtoUtils.marshaller(CreateFolderRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateFolderMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Folders/UpdateFolder") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateFolderRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor moveFolderMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Folders/MoveFolder") + .setRequestMarshaller(ProtoUtils.marshaller(MoveFolderRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteFolderMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Folders/DeleteFolder") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteFolderRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + undeleteFolderMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Folders/UndeleteFolder") + .setRequestMarshaller( + ProtoUtils.marshaller(UndeleteFolderRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Folders/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Folders/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Folders/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable getFolderCallable; + private final UnaryCallable listFoldersCallable; + private final UnaryCallable + listFoldersPagedCallable; + private final UnaryCallable searchFoldersCallable; + private final UnaryCallable + searchFoldersPagedCallable; + private final UnaryCallable createFolderCallable; + private final OperationCallable + createFolderOperationCallable; + private final UnaryCallable updateFolderCallable; + private final OperationCallable + updateFolderOperationCallable; + private final UnaryCallable moveFolderCallable; + private final OperationCallable + moveFolderOperationCallable; + private final UnaryCallable deleteFolderCallable; + private final OperationCallable + deleteFolderOperationCallable; + private final UnaryCallable undeleteFolderCallable; + private final OperationCallable + undeleteFolderOperationCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcFoldersStub create(FoldersStubSettings settings) throws IOException { + return new GrpcFoldersStub(settings, ClientContext.create(settings)); + } + + public static final GrpcFoldersStub create(ClientContext clientContext) throws IOException { + return new GrpcFoldersStub(FoldersStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcFoldersStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcFoldersStub( + FoldersStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcFoldersStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected GrpcFoldersStub(FoldersStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcFoldersCallableFactory()); + } + + /** + * Constructs an instance of GrpcFoldersStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected GrpcFoldersStub( + FoldersStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings getFolderTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getFolderMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetFolderRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings listFoldersTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listFoldersMethodDescriptor) + .build(); + GrpcCallSettings searchFoldersTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(searchFoldersMethodDescriptor) + .build(); + GrpcCallSettings createFolderTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createFolderMethodDescriptor) + .build(); + GrpcCallSettings updateFolderTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateFolderMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateFolderRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("folder.name", String.valueOf(request.getFolder().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings moveFolderTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(moveFolderMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(MoveFolderRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteFolderTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteFolderMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteFolderRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings undeleteFolderTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(undeleteFolderMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UndeleteFolderRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(TestIamPermissionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + + this.getFolderCallable = + callableFactory.createUnaryCallable( + getFolderTransportSettings, settings.getFolderSettings(), clientContext); + this.listFoldersCallable = + callableFactory.createUnaryCallable( + listFoldersTransportSettings, settings.listFoldersSettings(), clientContext); + this.listFoldersPagedCallable = + callableFactory.createPagedCallable( + listFoldersTransportSettings, settings.listFoldersSettings(), clientContext); + this.searchFoldersCallable = + callableFactory.createUnaryCallable( + searchFoldersTransportSettings, settings.searchFoldersSettings(), clientContext); + this.searchFoldersPagedCallable = + callableFactory.createPagedCallable( + searchFoldersTransportSettings, settings.searchFoldersSettings(), clientContext); + this.createFolderCallable = + callableFactory.createUnaryCallable( + createFolderTransportSettings, settings.createFolderSettings(), clientContext); + this.createFolderOperationCallable = + callableFactory.createOperationCallable( + createFolderTransportSettings, + settings.createFolderOperationSettings(), + clientContext, + operationsStub); + this.updateFolderCallable = + callableFactory.createUnaryCallable( + updateFolderTransportSettings, settings.updateFolderSettings(), clientContext); + this.updateFolderOperationCallable = + callableFactory.createOperationCallable( + updateFolderTransportSettings, + settings.updateFolderOperationSettings(), + clientContext, + operationsStub); + this.moveFolderCallable = + callableFactory.createUnaryCallable( + moveFolderTransportSettings, settings.moveFolderSettings(), clientContext); + this.moveFolderOperationCallable = + callableFactory.createOperationCallable( + moveFolderTransportSettings, + settings.moveFolderOperationSettings(), + clientContext, + operationsStub); + this.deleteFolderCallable = + callableFactory.createUnaryCallable( + deleteFolderTransportSettings, settings.deleteFolderSettings(), clientContext); + this.deleteFolderOperationCallable = + callableFactory.createOperationCallable( + deleteFolderTransportSettings, + settings.deleteFolderOperationSettings(), + clientContext, + operationsStub); + this.undeleteFolderCallable = + callableFactory.createUnaryCallable( + undeleteFolderTransportSettings, settings.undeleteFolderSettings(), clientContext); + this.undeleteFolderOperationCallable = + callableFactory.createOperationCallable( + undeleteFolderTransportSettings, + settings.undeleteFolderOperationSettings(), + clientContext, + operationsStub); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable getFolderCallable() { + return getFolderCallable; + } + + @Override + public UnaryCallable listFoldersCallable() { + return listFoldersCallable; + } + + @Override + public UnaryCallable listFoldersPagedCallable() { + return listFoldersPagedCallable; + } + + @Override + public UnaryCallable searchFoldersCallable() { + return searchFoldersCallable; + } + + @Override + public UnaryCallable + searchFoldersPagedCallable() { + return searchFoldersPagedCallable; + } + + @Override + public UnaryCallable createFolderCallable() { + return createFolderCallable; + } + + @Override + public OperationCallable + createFolderOperationCallable() { + return createFolderOperationCallable; + } + + @Override + public UnaryCallable updateFolderCallable() { + return updateFolderCallable; + } + + @Override + public OperationCallable + updateFolderOperationCallable() { + return updateFolderOperationCallable; + } + + @Override + public UnaryCallable moveFolderCallable() { + return moveFolderCallable; + } + + @Override + public OperationCallable + moveFolderOperationCallable() { + return moveFolderOperationCallable; + } + + @Override + public UnaryCallable deleteFolderCallable() { + return deleteFolderCallable; + } + + @Override + public OperationCallable + deleteFolderOperationCallable() { + return deleteFolderOperationCallable; + } + + @Override + public UnaryCallable undeleteFolderCallable() { + return undeleteFolderCallable; + } + + @Override + public OperationCallable + undeleteFolderOperationCallable() { + return undeleteFolderOperationCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcOrganizationsCallableFactory.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcOrganizationsCallableFactory.java new file mode 100644 index 000000000000..7d34e791c57b --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcOrganizationsCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Organizations service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcOrganizationsCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcOrganizationsStub.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcOrganizationsStub.java new file mode 100644 index 000000000000..0b24cfe5dd2b --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcOrganizationsStub.java @@ -0,0 +1,309 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3.stub; + +import static com.google.cloud.resourcemanager.v3.OrganizationsClient.SearchOrganizationsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.resourcemanager.v3.GetOrganizationRequest; +import com.google.cloud.resourcemanager.v3.Organization; +import com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest; +import com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the Organizations service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcOrganizationsStub extends OrganizationsStub { + private static final MethodDescriptor + getOrganizationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Organizations/GetOrganization") + .setRequestMarshaller( + ProtoUtils.marshaller(GetOrganizationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Organization.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + searchOrganizationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.resourcemanager.v3.Organizations/SearchOrganizations") + .setRequestMarshaller( + ProtoUtils.marshaller(SearchOrganizationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SearchOrganizationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Organizations/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Organizations/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Organizations/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable getOrganizationCallable; + private final UnaryCallable + searchOrganizationsCallable; + private final UnaryCallable + searchOrganizationsPagedCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcOrganizationsStub create(OrganizationsStubSettings settings) + throws IOException { + return new GrpcOrganizationsStub(settings, ClientContext.create(settings)); + } + + public static final GrpcOrganizationsStub create(ClientContext clientContext) throws IOException { + return new GrpcOrganizationsStub(OrganizationsStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcOrganizationsStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcOrganizationsStub( + OrganizationsStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcOrganizationsStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcOrganizationsStub(OrganizationsStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcOrganizationsCallableFactory()); + } + + /** + * Constructs an instance of GrpcOrganizationsStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcOrganizationsStub( + OrganizationsStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings getOrganizationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getOrganizationMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetOrganizationRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + searchOrganizationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(searchOrganizationsMethodDescriptor) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(TestIamPermissionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + + this.getOrganizationCallable = + callableFactory.createUnaryCallable( + getOrganizationTransportSettings, settings.getOrganizationSettings(), clientContext); + this.searchOrganizationsCallable = + callableFactory.createUnaryCallable( + searchOrganizationsTransportSettings, + settings.searchOrganizationsSettings(), + clientContext); + this.searchOrganizationsPagedCallable = + callableFactory.createPagedCallable( + searchOrganizationsTransportSettings, + settings.searchOrganizationsSettings(), + clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable getOrganizationCallable() { + return getOrganizationCallable; + } + + @Override + public UnaryCallable + searchOrganizationsCallable() { + return searchOrganizationsCallable; + } + + @Override + public UnaryCallable + searchOrganizationsPagedCallable() { + return searchOrganizationsPagedCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcProjectsCallableFactory.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcProjectsCallableFactory.java new file mode 100644 index 000000000000..7627858500ec --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcProjectsCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Projects service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcProjectsCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcProjectsStub.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcProjectsStub.java new file mode 100644 index 000000000000..ea727ba9dd24 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcProjectsStub.java @@ -0,0 +1,564 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3.stub; + +import static com.google.cloud.resourcemanager.v3.ProjectsClient.ListProjectsPagedResponse; +import static com.google.cloud.resourcemanager.v3.ProjectsClient.SearchProjectsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.resourcemanager.v3.CreateProjectMetadata; +import com.google.cloud.resourcemanager.v3.CreateProjectRequest; +import com.google.cloud.resourcemanager.v3.DeleteProjectMetadata; +import com.google.cloud.resourcemanager.v3.DeleteProjectRequest; +import com.google.cloud.resourcemanager.v3.GetProjectRequest; +import com.google.cloud.resourcemanager.v3.ListProjectsRequest; +import com.google.cloud.resourcemanager.v3.ListProjectsResponse; +import com.google.cloud.resourcemanager.v3.MoveProjectMetadata; +import com.google.cloud.resourcemanager.v3.MoveProjectRequest; +import com.google.cloud.resourcemanager.v3.Project; +import com.google.cloud.resourcemanager.v3.SearchProjectsRequest; +import com.google.cloud.resourcemanager.v3.SearchProjectsResponse; +import com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata; +import com.google.cloud.resourcemanager.v3.UndeleteProjectRequest; +import com.google.cloud.resourcemanager.v3.UpdateProjectMetadata; +import com.google.cloud.resourcemanager.v3.UpdateProjectRequest; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the Projects service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcProjectsStub extends ProjectsStub { + private static final MethodDescriptor getProjectMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Projects/GetProject") + .setRequestMarshaller(ProtoUtils.marshaller(GetProjectRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Project.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listProjectsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Projects/ListProjects") + .setRequestMarshaller(ProtoUtils.marshaller(ListProjectsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListProjectsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + searchProjectsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Projects/SearchProjects") + .setRequestMarshaller( + ProtoUtils.marshaller(SearchProjectsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SearchProjectsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createProjectMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Projects/CreateProject") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateProjectRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateProjectMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Projects/UpdateProject") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateProjectRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor moveProjectMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Projects/MoveProject") + .setRequestMarshaller(ProtoUtils.marshaller(MoveProjectRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteProjectMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Projects/DeleteProject") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteProjectRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + undeleteProjectMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Projects/UndeleteProject") + .setRequestMarshaller( + ProtoUtils.marshaller(UndeleteProjectRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Projects/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Projects/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.Projects/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable getProjectCallable; + private final UnaryCallable listProjectsCallable; + private final UnaryCallable + listProjectsPagedCallable; + private final UnaryCallable searchProjectsCallable; + private final UnaryCallable + searchProjectsPagedCallable; + private final UnaryCallable createProjectCallable; + private final OperationCallable + createProjectOperationCallable; + private final UnaryCallable updateProjectCallable; + private final OperationCallable + updateProjectOperationCallable; + private final UnaryCallable moveProjectCallable; + private final OperationCallable + moveProjectOperationCallable; + private final UnaryCallable deleteProjectCallable; + private final OperationCallable + deleteProjectOperationCallable; + private final UnaryCallable undeleteProjectCallable; + private final OperationCallable + undeleteProjectOperationCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcProjectsStub create(ProjectsStubSettings settings) throws IOException { + return new GrpcProjectsStub(settings, ClientContext.create(settings)); + } + + public static final GrpcProjectsStub create(ClientContext clientContext) throws IOException { + return new GrpcProjectsStub(ProjectsStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcProjectsStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcProjectsStub( + ProjectsStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcProjectsStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected GrpcProjectsStub(ProjectsStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcProjectsCallableFactory()); + } + + /** + * Constructs an instance of GrpcProjectsStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected GrpcProjectsStub( + ProjectsStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings getProjectTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getProjectMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetProjectRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings listProjectsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listProjectsMethodDescriptor) + .build(); + GrpcCallSettings + searchProjectsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(searchProjectsMethodDescriptor) + .build(); + GrpcCallSettings createProjectTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createProjectMethodDescriptor) + .build(); + GrpcCallSettings updateProjectTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateProjectMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateProjectRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("project.name", String.valueOf(request.getProject().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings moveProjectTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(moveProjectMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(MoveProjectRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteProjectTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteProjectMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteProjectRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings undeleteProjectTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(undeleteProjectMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UndeleteProjectRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(TestIamPermissionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + + this.getProjectCallable = + callableFactory.createUnaryCallable( + getProjectTransportSettings, settings.getProjectSettings(), clientContext); + this.listProjectsCallable = + callableFactory.createUnaryCallable( + listProjectsTransportSettings, settings.listProjectsSettings(), clientContext); + this.listProjectsPagedCallable = + callableFactory.createPagedCallable( + listProjectsTransportSettings, settings.listProjectsSettings(), clientContext); + this.searchProjectsCallable = + callableFactory.createUnaryCallable( + searchProjectsTransportSettings, settings.searchProjectsSettings(), clientContext); + this.searchProjectsPagedCallable = + callableFactory.createPagedCallable( + searchProjectsTransportSettings, settings.searchProjectsSettings(), clientContext); + this.createProjectCallable = + callableFactory.createUnaryCallable( + createProjectTransportSettings, settings.createProjectSettings(), clientContext); + this.createProjectOperationCallable = + callableFactory.createOperationCallable( + createProjectTransportSettings, + settings.createProjectOperationSettings(), + clientContext, + operationsStub); + this.updateProjectCallable = + callableFactory.createUnaryCallable( + updateProjectTransportSettings, settings.updateProjectSettings(), clientContext); + this.updateProjectOperationCallable = + callableFactory.createOperationCallable( + updateProjectTransportSettings, + settings.updateProjectOperationSettings(), + clientContext, + operationsStub); + this.moveProjectCallable = + callableFactory.createUnaryCallable( + moveProjectTransportSettings, settings.moveProjectSettings(), clientContext); + this.moveProjectOperationCallable = + callableFactory.createOperationCallable( + moveProjectTransportSettings, + settings.moveProjectOperationSettings(), + clientContext, + operationsStub); + this.deleteProjectCallable = + callableFactory.createUnaryCallable( + deleteProjectTransportSettings, settings.deleteProjectSettings(), clientContext); + this.deleteProjectOperationCallable = + callableFactory.createOperationCallable( + deleteProjectTransportSettings, + settings.deleteProjectOperationSettings(), + clientContext, + operationsStub); + this.undeleteProjectCallable = + callableFactory.createUnaryCallable( + undeleteProjectTransportSettings, settings.undeleteProjectSettings(), clientContext); + this.undeleteProjectOperationCallable = + callableFactory.createOperationCallable( + undeleteProjectTransportSettings, + settings.undeleteProjectOperationSettings(), + clientContext, + operationsStub); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable getProjectCallable() { + return getProjectCallable; + } + + @Override + public UnaryCallable listProjectsCallable() { + return listProjectsCallable; + } + + @Override + public UnaryCallable listProjectsPagedCallable() { + return listProjectsPagedCallable; + } + + @Override + public UnaryCallable searchProjectsCallable() { + return searchProjectsCallable; + } + + @Override + public UnaryCallable + searchProjectsPagedCallable() { + return searchProjectsPagedCallable; + } + + @Override + public UnaryCallable createProjectCallable() { + return createProjectCallable; + } + + @Override + public OperationCallable + createProjectOperationCallable() { + return createProjectOperationCallable; + } + + @Override + public UnaryCallable updateProjectCallable() { + return updateProjectCallable; + } + + @Override + public OperationCallable + updateProjectOperationCallable() { + return updateProjectOperationCallable; + } + + @Override + public UnaryCallable moveProjectCallable() { + return moveProjectCallable; + } + + @Override + public OperationCallable + moveProjectOperationCallable() { + return moveProjectOperationCallable; + } + + @Override + public UnaryCallable deleteProjectCallable() { + return deleteProjectCallable; + } + + @Override + public OperationCallable + deleteProjectOperationCallable() { + return deleteProjectOperationCallable; + } + + @Override + public UnaryCallable undeleteProjectCallable() { + return undeleteProjectCallable; + } + + @Override + public OperationCallable + undeleteProjectOperationCallable() { + return undeleteProjectOperationCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcTagBindingsCallableFactory.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcTagBindingsCallableFactory.java new file mode 100644 index 000000000000..d7be7126c342 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcTagBindingsCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the TagBindings service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcTagBindingsCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcTagBindingsStub.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcTagBindingsStub.java new file mode 100644 index 000000000000..b77ed0ca060b --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcTagBindingsStub.java @@ -0,0 +1,257 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3.stub; + +import static com.google.cloud.resourcemanager.v3.TagBindingsClient.ListTagBindingsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata; +import com.google.cloud.resourcemanager.v3.CreateTagBindingRequest; +import com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata; +import com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest; +import com.google.cloud.resourcemanager.v3.ListTagBindingsRequest; +import com.google.cloud.resourcemanager.v3.ListTagBindingsResponse; +import com.google.cloud.resourcemanager.v3.TagBinding; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the TagBindings service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcTagBindingsStub extends TagBindingsStub { + private static final MethodDescriptor + listTagBindingsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.TagBindings/ListTagBindings") + .setRequestMarshaller( + ProtoUtils.marshaller(ListTagBindingsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListTagBindingsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createTagBindingMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.TagBindings/CreateTagBinding") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateTagBindingRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteTagBindingMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.TagBindings/DeleteTagBinding") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteTagBindingRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable + listTagBindingsCallable; + private final UnaryCallable + listTagBindingsPagedCallable; + private final UnaryCallable createTagBindingCallable; + private final OperationCallable + createTagBindingOperationCallable; + private final UnaryCallable deleteTagBindingCallable; + private final OperationCallable + deleteTagBindingOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcTagBindingsStub create(TagBindingsStubSettings settings) + throws IOException { + return new GrpcTagBindingsStub(settings, ClientContext.create(settings)); + } + + public static final GrpcTagBindingsStub create(ClientContext clientContext) throws IOException { + return new GrpcTagBindingsStub(TagBindingsStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcTagBindingsStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcTagBindingsStub( + TagBindingsStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcTagBindingsStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcTagBindingsStub(TagBindingsStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcTagBindingsCallableFactory()); + } + + /** + * Constructs an instance of GrpcTagBindingsStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcTagBindingsStub( + TagBindingsStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listTagBindingsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listTagBindingsMethodDescriptor) + .build(); + GrpcCallSettings createTagBindingTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createTagBindingMethodDescriptor) + .build(); + GrpcCallSettings deleteTagBindingTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteTagBindingMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteTagBindingRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + + this.listTagBindingsCallable = + callableFactory.createUnaryCallable( + listTagBindingsTransportSettings, settings.listTagBindingsSettings(), clientContext); + this.listTagBindingsPagedCallable = + callableFactory.createPagedCallable( + listTagBindingsTransportSettings, settings.listTagBindingsSettings(), clientContext); + this.createTagBindingCallable = + callableFactory.createUnaryCallable( + createTagBindingTransportSettings, settings.createTagBindingSettings(), clientContext); + this.createTagBindingOperationCallable = + callableFactory.createOperationCallable( + createTagBindingTransportSettings, + settings.createTagBindingOperationSettings(), + clientContext, + operationsStub); + this.deleteTagBindingCallable = + callableFactory.createUnaryCallable( + deleteTagBindingTransportSettings, settings.deleteTagBindingSettings(), clientContext); + this.deleteTagBindingOperationCallable = + callableFactory.createOperationCallable( + deleteTagBindingTransportSettings, + settings.deleteTagBindingOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listTagBindingsCallable() { + return listTagBindingsCallable; + } + + @Override + public UnaryCallable + listTagBindingsPagedCallable() { + return listTagBindingsPagedCallable; + } + + @Override + public UnaryCallable createTagBindingCallable() { + return createTagBindingCallable; + } + + @Override + public OperationCallable + createTagBindingOperationCallable() { + return createTagBindingOperationCallable; + } + + @Override + public UnaryCallable deleteTagBindingCallable() { + return deleteTagBindingCallable; + } + + @Override + public OperationCallable + deleteTagBindingOperationCallable() { + return deleteTagBindingOperationCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcTagKeysCallableFactory.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcTagKeysCallableFactory.java new file mode 100644 index 000000000000..ba3bdaad8d01 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcTagKeysCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the TagKeys service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcTagKeysCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcTagKeysStub.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcTagKeysStub.java new file mode 100644 index 000000000000..9cb861f39bc5 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcTagKeysStub.java @@ -0,0 +1,428 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3.stub; + +import static com.google.cloud.resourcemanager.v3.TagKeysClient.ListTagKeysPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata; +import com.google.cloud.resourcemanager.v3.CreateTagKeyRequest; +import com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata; +import com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest; +import com.google.cloud.resourcemanager.v3.GetTagKeyRequest; +import com.google.cloud.resourcemanager.v3.ListTagKeysRequest; +import com.google.cloud.resourcemanager.v3.ListTagKeysResponse; +import com.google.cloud.resourcemanager.v3.TagKey; +import com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata; +import com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the TagKeys service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcTagKeysStub extends TagKeysStub { + private static final MethodDescriptor + listTagKeysMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.TagKeys/ListTagKeys") + .setRequestMarshaller(ProtoUtils.marshaller(ListTagKeysRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListTagKeysResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getTagKeyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.TagKeys/GetTagKey") + .setRequestMarshaller(ProtoUtils.marshaller(GetTagKeyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(TagKey.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createTagKeyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.TagKeys/CreateTagKey") + .setRequestMarshaller(ProtoUtils.marshaller(CreateTagKeyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateTagKeyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.TagKeys/UpdateTagKey") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateTagKeyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteTagKeyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.TagKeys/DeleteTagKey") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteTagKeyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.TagKeys/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.TagKeys/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.TagKeys/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable listTagKeysCallable; + private final UnaryCallable + listTagKeysPagedCallable; + private final UnaryCallable getTagKeyCallable; + private final UnaryCallable createTagKeyCallable; + private final OperationCallable + createTagKeyOperationCallable; + private final UnaryCallable updateTagKeyCallable; + private final OperationCallable + updateTagKeyOperationCallable; + private final UnaryCallable deleteTagKeyCallable; + private final OperationCallable + deleteTagKeyOperationCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcTagKeysStub create(TagKeysStubSettings settings) throws IOException { + return new GrpcTagKeysStub(settings, ClientContext.create(settings)); + } + + public static final GrpcTagKeysStub create(ClientContext clientContext) throws IOException { + return new GrpcTagKeysStub(TagKeysStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcTagKeysStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcTagKeysStub( + TagKeysStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcTagKeysStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected GrpcTagKeysStub(TagKeysStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcTagKeysCallableFactory()); + } + + /** + * Constructs an instance of GrpcTagKeysStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected GrpcTagKeysStub( + TagKeysStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listTagKeysTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listTagKeysMethodDescriptor) + .build(); + GrpcCallSettings getTagKeyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getTagKeyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetTagKeyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createTagKeyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createTagKeyMethodDescriptor) + .build(); + GrpcCallSettings updateTagKeyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateTagKeyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateTagKeyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("tag_key.name", String.valueOf(request.getTagKey().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteTagKeyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteTagKeyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteTagKeyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(TestIamPermissionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + + this.listTagKeysCallable = + callableFactory.createUnaryCallable( + listTagKeysTransportSettings, settings.listTagKeysSettings(), clientContext); + this.listTagKeysPagedCallable = + callableFactory.createPagedCallable( + listTagKeysTransportSettings, settings.listTagKeysSettings(), clientContext); + this.getTagKeyCallable = + callableFactory.createUnaryCallable( + getTagKeyTransportSettings, settings.getTagKeySettings(), clientContext); + this.createTagKeyCallable = + callableFactory.createUnaryCallable( + createTagKeyTransportSettings, settings.createTagKeySettings(), clientContext); + this.createTagKeyOperationCallable = + callableFactory.createOperationCallable( + createTagKeyTransportSettings, + settings.createTagKeyOperationSettings(), + clientContext, + operationsStub); + this.updateTagKeyCallable = + callableFactory.createUnaryCallable( + updateTagKeyTransportSettings, settings.updateTagKeySettings(), clientContext); + this.updateTagKeyOperationCallable = + callableFactory.createOperationCallable( + updateTagKeyTransportSettings, + settings.updateTagKeyOperationSettings(), + clientContext, + operationsStub); + this.deleteTagKeyCallable = + callableFactory.createUnaryCallable( + deleteTagKeyTransportSettings, settings.deleteTagKeySettings(), clientContext); + this.deleteTagKeyOperationCallable = + callableFactory.createOperationCallable( + deleteTagKeyTransportSettings, + settings.deleteTagKeyOperationSettings(), + clientContext, + operationsStub); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listTagKeysCallable() { + return listTagKeysCallable; + } + + @Override + public UnaryCallable listTagKeysPagedCallable() { + return listTagKeysPagedCallable; + } + + @Override + public UnaryCallable getTagKeyCallable() { + return getTagKeyCallable; + } + + @Override + public UnaryCallable createTagKeyCallable() { + return createTagKeyCallable; + } + + @Override + public OperationCallable + createTagKeyOperationCallable() { + return createTagKeyOperationCallable; + } + + @Override + public UnaryCallable updateTagKeyCallable() { + return updateTagKeyCallable; + } + + @Override + public OperationCallable + updateTagKeyOperationCallable() { + return updateTagKeyOperationCallable; + } + + @Override + public UnaryCallable deleteTagKeyCallable() { + return deleteTagKeyCallable; + } + + @Override + public OperationCallable + deleteTagKeyOperationCallable() { + return deleteTagKeyOperationCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcTagValuesCallableFactory.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcTagValuesCallableFactory.java new file mode 100644 index 000000000000..b70801978a9f --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcTagValuesCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the TagValues service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcTagValuesCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcTagValuesStub.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcTagValuesStub.java new file mode 100644 index 000000000000..77e8962d6a09 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/GrpcTagValuesStub.java @@ -0,0 +1,435 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3.stub; + +import static com.google.cloud.resourcemanager.v3.TagValuesClient.ListTagValuesPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.resourcemanager.v3.CreateTagValueMetadata; +import com.google.cloud.resourcemanager.v3.CreateTagValueRequest; +import com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata; +import com.google.cloud.resourcemanager.v3.DeleteTagValueRequest; +import com.google.cloud.resourcemanager.v3.GetTagValueRequest; +import com.google.cloud.resourcemanager.v3.ListTagValuesRequest; +import com.google.cloud.resourcemanager.v3.ListTagValuesResponse; +import com.google.cloud.resourcemanager.v3.TagValue; +import com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata; +import com.google.cloud.resourcemanager.v3.UpdateTagValueRequest; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the TagValues service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcTagValuesStub extends TagValuesStub { + private static final MethodDescriptor + listTagValuesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.TagValues/ListTagValues") + .setRequestMarshaller( + ProtoUtils.marshaller(ListTagValuesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListTagValuesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getTagValueMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.TagValues/GetTagValue") + .setRequestMarshaller(ProtoUtils.marshaller(GetTagValueRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(TagValue.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createTagValueMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.TagValues/CreateTagValue") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateTagValueRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateTagValueMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.TagValues/UpdateTagValue") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateTagValueRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteTagValueMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.TagValues/DeleteTagValue") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteTagValueRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.TagValues/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.TagValues/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.resourcemanager.v3.TagValues/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable listTagValuesCallable; + private final UnaryCallable + listTagValuesPagedCallable; + private final UnaryCallable getTagValueCallable; + private final UnaryCallable createTagValueCallable; + private final OperationCallable + createTagValueOperationCallable; + private final UnaryCallable updateTagValueCallable; + private final OperationCallable + updateTagValueOperationCallable; + private final UnaryCallable deleteTagValueCallable; + private final OperationCallable + deleteTagValueOperationCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcTagValuesStub create(TagValuesStubSettings settings) throws IOException { + return new GrpcTagValuesStub(settings, ClientContext.create(settings)); + } + + public static final GrpcTagValuesStub create(ClientContext clientContext) throws IOException { + return new GrpcTagValuesStub(TagValuesStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcTagValuesStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcTagValuesStub( + TagValuesStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcTagValuesStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcTagValuesStub(TagValuesStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcTagValuesCallableFactory()); + } + + /** + * Constructs an instance of GrpcTagValuesStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcTagValuesStub( + TagValuesStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listTagValuesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listTagValuesMethodDescriptor) + .build(); + GrpcCallSettings getTagValueTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getTagValueMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetTagValueRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createTagValueTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createTagValueMethodDescriptor) + .build(); + GrpcCallSettings updateTagValueTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateTagValueMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateTagValueRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("tag_value.name", String.valueOf(request.getTagValue().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteTagValueTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteTagValueMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteTagValueRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(TestIamPermissionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + + this.listTagValuesCallable = + callableFactory.createUnaryCallable( + listTagValuesTransportSettings, settings.listTagValuesSettings(), clientContext); + this.listTagValuesPagedCallable = + callableFactory.createPagedCallable( + listTagValuesTransportSettings, settings.listTagValuesSettings(), clientContext); + this.getTagValueCallable = + callableFactory.createUnaryCallable( + getTagValueTransportSettings, settings.getTagValueSettings(), clientContext); + this.createTagValueCallable = + callableFactory.createUnaryCallable( + createTagValueTransportSettings, settings.createTagValueSettings(), clientContext); + this.createTagValueOperationCallable = + callableFactory.createOperationCallable( + createTagValueTransportSettings, + settings.createTagValueOperationSettings(), + clientContext, + operationsStub); + this.updateTagValueCallable = + callableFactory.createUnaryCallable( + updateTagValueTransportSettings, settings.updateTagValueSettings(), clientContext); + this.updateTagValueOperationCallable = + callableFactory.createOperationCallable( + updateTagValueTransportSettings, + settings.updateTagValueOperationSettings(), + clientContext, + operationsStub); + this.deleteTagValueCallable = + callableFactory.createUnaryCallable( + deleteTagValueTransportSettings, settings.deleteTagValueSettings(), clientContext); + this.deleteTagValueOperationCallable = + callableFactory.createOperationCallable( + deleteTagValueTransportSettings, + settings.deleteTagValueOperationSettings(), + clientContext, + operationsStub); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listTagValuesCallable() { + return listTagValuesCallable; + } + + @Override + public UnaryCallable + listTagValuesPagedCallable() { + return listTagValuesPagedCallable; + } + + @Override + public UnaryCallable getTagValueCallable() { + return getTagValueCallable; + } + + @Override + public UnaryCallable createTagValueCallable() { + return createTagValueCallable; + } + + @Override + public OperationCallable + createTagValueOperationCallable() { + return createTagValueOperationCallable; + } + + @Override + public UnaryCallable updateTagValueCallable() { + return updateTagValueCallable; + } + + @Override + public OperationCallable + updateTagValueOperationCallable() { + return updateTagValueOperationCallable; + } + + @Override + public UnaryCallable deleteTagValueCallable() { + return deleteTagValueCallable; + } + + @Override + public OperationCallable + deleteTagValueOperationCallable() { + return deleteTagValueOperationCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/OrganizationsStub.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/OrganizationsStub.java new file mode 100644 index 000000000000..d108be51c753 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/OrganizationsStub.java @@ -0,0 +1,72 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3.stub; + +import static com.google.cloud.resourcemanager.v3.OrganizationsClient.SearchOrganizationsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.resourcemanager.v3.GetOrganizationRequest; +import com.google.cloud.resourcemanager.v3.Organization; +import com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest; +import com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Organizations service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class OrganizationsStub implements BackgroundResource { + + public UnaryCallable getOrganizationCallable() { + throw new UnsupportedOperationException("Not implemented: getOrganizationCallable()"); + } + + public UnaryCallable + searchOrganizationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: searchOrganizationsPagedCallable()"); + } + + public UnaryCallable + searchOrganizationsCallable() { + throw new UnsupportedOperationException("Not implemented: searchOrganizationsCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/OrganizationsStubSettings.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/OrganizationsStubSettings.java new file mode 100644 index 000000000000..fa9e7b29620c --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/OrganizationsStubSettings.java @@ -0,0 +1,469 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3.stub; + +import static com.google.cloud.resourcemanager.v3.OrganizationsClient.SearchOrganizationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.resourcemanager.v3.GetOrganizationRequest; +import com.google.cloud.resourcemanager.v3.Organization; +import com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest; +import com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link OrganizationsStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (cloudresourcemanager.googleapis.com) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getOrganization to 30 seconds: + * + *

{@code
+ * OrganizationsStubSettings.Builder organizationsSettingsBuilder =
+ *     OrganizationsStubSettings.newBuilder();
+ * organizationsSettingsBuilder
+ *     .getOrganizationSettings()
+ *     .setRetrySettings(
+ *         organizationsSettingsBuilder
+ *             .getOrganizationSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * OrganizationsStubSettings organizationsSettings = organizationsSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class OrganizationsStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/cloud-platform.read-only") + .build(); + + private final UnaryCallSettings getOrganizationSettings; + private final PagedCallSettings< + SearchOrganizationsRequest, SearchOrganizationsResponse, SearchOrganizationsPagedResponse> + searchOrganizationsSettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor< + SearchOrganizationsRequest, SearchOrganizationsResponse, Organization> + SEARCH_ORGANIZATIONS_PAGE_STR_DESC = + new PagedListDescriptor< + SearchOrganizationsRequest, SearchOrganizationsResponse, Organization>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public SearchOrganizationsRequest injectToken( + SearchOrganizationsRequest payload, String token) { + return SearchOrganizationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public SearchOrganizationsRequest injectPageSize( + SearchOrganizationsRequest payload, int pageSize) { + return SearchOrganizationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(SearchOrganizationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(SearchOrganizationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(SearchOrganizationsResponse payload) { + return payload.getOrganizationsList() == null + ? ImmutableList.of() + : payload.getOrganizationsList(); + } + }; + + private static final PagedListResponseFactory< + SearchOrganizationsRequest, SearchOrganizationsResponse, SearchOrganizationsPagedResponse> + SEARCH_ORGANIZATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + SearchOrganizationsRequest, + SearchOrganizationsResponse, + SearchOrganizationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + SearchOrganizationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, SEARCH_ORGANIZATIONS_PAGE_STR_DESC, request, context); + return SearchOrganizationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to getOrganization. */ + public UnaryCallSettings getOrganizationSettings() { + return getOrganizationSettings; + } + + /** Returns the object with the settings used for calls to searchOrganizations. */ + public PagedCallSettings< + SearchOrganizationsRequest, SearchOrganizationsResponse, SearchOrganizationsPagedResponse> + searchOrganizationsSettings() { + return searchOrganizationsSettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public OrganizationsStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcOrganizationsStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "cloudresourcemanager.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(OrganizationsStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected OrganizationsStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getOrganizationSettings = settingsBuilder.getOrganizationSettings().build(); + searchOrganizationsSettings = settingsBuilder.searchOrganizationsSettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for OrganizationsStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + getOrganizationSettings; + private final PagedCallSettings.Builder< + SearchOrganizationsRequest, + SearchOrganizationsResponse, + SearchOrganizationsPagedResponse> + searchOrganizationsSettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_1_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getOrganizationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + searchOrganizationsSettings = + PagedCallSettings.newBuilder(SEARCH_ORGANIZATIONS_PAGE_STR_FACT); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getOrganizationSettings, + searchOrganizationsSettings, + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(OrganizationsStubSettings settings) { + super(settings); + + getOrganizationSettings = settings.getOrganizationSettings.toBuilder(); + searchOrganizationsSettings = settings.searchOrganizationsSettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getOrganizationSettings, + searchOrganizationsSettings, + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .getOrganizationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .searchOrganizationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + return builder; + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to getOrganization. */ + public UnaryCallSettings.Builder + getOrganizationSettings() { + return getOrganizationSettings; + } + + /** Returns the builder for the settings used for calls to searchOrganizations. */ + public PagedCallSettings.Builder< + SearchOrganizationsRequest, + SearchOrganizationsResponse, + SearchOrganizationsPagedResponse> + searchOrganizationsSettings() { + return searchOrganizationsSettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public OrganizationsStubSettings build() throws IOException { + return new OrganizationsStubSettings(this); + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/ProjectsStub.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/ProjectsStub.java new file mode 100644 index 000000000000..b4f00e39a8d8 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/ProjectsStub.java @@ -0,0 +1,144 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3.stub; + +import static com.google.cloud.resourcemanager.v3.ProjectsClient.ListProjectsPagedResponse; +import static com.google.cloud.resourcemanager.v3.ProjectsClient.SearchProjectsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.resourcemanager.v3.CreateProjectMetadata; +import com.google.cloud.resourcemanager.v3.CreateProjectRequest; +import com.google.cloud.resourcemanager.v3.DeleteProjectMetadata; +import com.google.cloud.resourcemanager.v3.DeleteProjectRequest; +import com.google.cloud.resourcemanager.v3.GetProjectRequest; +import com.google.cloud.resourcemanager.v3.ListProjectsRequest; +import com.google.cloud.resourcemanager.v3.ListProjectsResponse; +import com.google.cloud.resourcemanager.v3.MoveProjectMetadata; +import com.google.cloud.resourcemanager.v3.MoveProjectRequest; +import com.google.cloud.resourcemanager.v3.Project; +import com.google.cloud.resourcemanager.v3.SearchProjectsRequest; +import com.google.cloud.resourcemanager.v3.SearchProjectsResponse; +import com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata; +import com.google.cloud.resourcemanager.v3.UndeleteProjectRequest; +import com.google.cloud.resourcemanager.v3.UpdateProjectMetadata; +import com.google.cloud.resourcemanager.v3.UpdateProjectRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Projects service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class ProjectsStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable getProjectCallable() { + throw new UnsupportedOperationException("Not implemented: getProjectCallable()"); + } + + public UnaryCallable listProjectsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listProjectsPagedCallable()"); + } + + public UnaryCallable listProjectsCallable() { + throw new UnsupportedOperationException("Not implemented: listProjectsCallable()"); + } + + public UnaryCallable + searchProjectsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: searchProjectsPagedCallable()"); + } + + public UnaryCallable searchProjectsCallable() { + throw new UnsupportedOperationException("Not implemented: searchProjectsCallable()"); + } + + public OperationCallable + createProjectOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createProjectOperationCallable()"); + } + + public UnaryCallable createProjectCallable() { + throw new UnsupportedOperationException("Not implemented: createProjectCallable()"); + } + + public OperationCallable + updateProjectOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateProjectOperationCallable()"); + } + + public UnaryCallable updateProjectCallable() { + throw new UnsupportedOperationException("Not implemented: updateProjectCallable()"); + } + + public OperationCallable + moveProjectOperationCallable() { + throw new UnsupportedOperationException("Not implemented: moveProjectOperationCallable()"); + } + + public UnaryCallable moveProjectCallable() { + throw new UnsupportedOperationException("Not implemented: moveProjectCallable()"); + } + + public OperationCallable + deleteProjectOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteProjectOperationCallable()"); + } + + public UnaryCallable deleteProjectCallable() { + throw new UnsupportedOperationException("Not implemented: deleteProjectCallable()"); + } + + public OperationCallable + undeleteProjectOperationCallable() { + throw new UnsupportedOperationException("Not implemented: undeleteProjectOperationCallable()"); + } + + public UnaryCallable undeleteProjectCallable() { + throw new UnsupportedOperationException("Not implemented: undeleteProjectCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/ProjectsStubSettings.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/ProjectsStubSettings.java new file mode 100644 index 000000000000..1f1c1fecbcab --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/ProjectsStubSettings.java @@ -0,0 +1,892 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3.stub; + +import static com.google.cloud.resourcemanager.v3.ProjectsClient.ListProjectsPagedResponse; +import static com.google.cloud.resourcemanager.v3.ProjectsClient.SearchProjectsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.resourcemanager.v3.CreateProjectMetadata; +import com.google.cloud.resourcemanager.v3.CreateProjectRequest; +import com.google.cloud.resourcemanager.v3.DeleteProjectMetadata; +import com.google.cloud.resourcemanager.v3.DeleteProjectRequest; +import com.google.cloud.resourcemanager.v3.GetProjectRequest; +import com.google.cloud.resourcemanager.v3.ListProjectsRequest; +import com.google.cloud.resourcemanager.v3.ListProjectsResponse; +import com.google.cloud.resourcemanager.v3.MoveProjectMetadata; +import com.google.cloud.resourcemanager.v3.MoveProjectRequest; +import com.google.cloud.resourcemanager.v3.Project; +import com.google.cloud.resourcemanager.v3.SearchProjectsRequest; +import com.google.cloud.resourcemanager.v3.SearchProjectsResponse; +import com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata; +import com.google.cloud.resourcemanager.v3.UndeleteProjectRequest; +import com.google.cloud.resourcemanager.v3.UpdateProjectMetadata; +import com.google.cloud.resourcemanager.v3.UpdateProjectRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link ProjectsStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (cloudresourcemanager.googleapis.com) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getProject to 30 seconds: + * + *

{@code
+ * ProjectsStubSettings.Builder projectsSettingsBuilder = ProjectsStubSettings.newBuilder();
+ * projectsSettingsBuilder
+ *     .getProjectSettings()
+ *     .setRetrySettings(
+ *         projectsSettingsBuilder
+ *             .getProjectSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ProjectsStubSettings projectsSettings = projectsSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ProjectsStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/cloud-platform.read-only") + .build(); + + private final UnaryCallSettings getProjectSettings; + private final PagedCallSettings< + ListProjectsRequest, ListProjectsResponse, ListProjectsPagedResponse> + listProjectsSettings; + private final PagedCallSettings< + SearchProjectsRequest, SearchProjectsResponse, SearchProjectsPagedResponse> + searchProjectsSettings; + private final UnaryCallSettings createProjectSettings; + private final OperationCallSettings + createProjectOperationSettings; + private final UnaryCallSettings updateProjectSettings; + private final OperationCallSettings + updateProjectOperationSettings; + private final UnaryCallSettings moveProjectSettings; + private final OperationCallSettings + moveProjectOperationSettings; + private final UnaryCallSettings deleteProjectSettings; + private final OperationCallSettings + deleteProjectOperationSettings; + private final UnaryCallSettings undeleteProjectSettings; + private final OperationCallSettings + undeleteProjectOperationSettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_PROJECTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListProjectsRequest injectToken(ListProjectsRequest payload, String token) { + return ListProjectsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListProjectsRequest injectPageSize(ListProjectsRequest payload, int pageSize) { + return ListProjectsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListProjectsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListProjectsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListProjectsResponse payload) { + return payload.getProjectsList() == null + ? ImmutableList.of() + : payload.getProjectsList(); + } + }; + + private static final PagedListDescriptor + SEARCH_PROJECTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public SearchProjectsRequest injectToken(SearchProjectsRequest payload, String token) { + return SearchProjectsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public SearchProjectsRequest injectPageSize( + SearchProjectsRequest payload, int pageSize) { + return SearchProjectsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(SearchProjectsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(SearchProjectsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(SearchProjectsResponse payload) { + return payload.getProjectsList() == null + ? ImmutableList.of() + : payload.getProjectsList(); + } + }; + + private static final PagedListResponseFactory< + ListProjectsRequest, ListProjectsResponse, ListProjectsPagedResponse> + LIST_PROJECTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListProjectsRequest, ListProjectsResponse, ListProjectsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListProjectsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_PROJECTS_PAGE_STR_DESC, request, context); + return ListProjectsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + SearchProjectsRequest, SearchProjectsResponse, SearchProjectsPagedResponse> + SEARCH_PROJECTS_PAGE_STR_FACT = + new PagedListResponseFactory< + SearchProjectsRequest, SearchProjectsResponse, SearchProjectsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + SearchProjectsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, SEARCH_PROJECTS_PAGE_STR_DESC, request, context); + return SearchProjectsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to getProject. */ + public UnaryCallSettings getProjectSettings() { + return getProjectSettings; + } + + /** Returns the object with the settings used for calls to listProjects. */ + public PagedCallSettings + listProjectsSettings() { + return listProjectsSettings; + } + + /** Returns the object with the settings used for calls to searchProjects. */ + public PagedCallSettings< + SearchProjectsRequest, SearchProjectsResponse, SearchProjectsPagedResponse> + searchProjectsSettings() { + return searchProjectsSettings; + } + + /** Returns the object with the settings used for calls to createProject. */ + public UnaryCallSettings createProjectSettings() { + return createProjectSettings; + } + + /** Returns the object with the settings used for calls to createProject. */ + public OperationCallSettings + createProjectOperationSettings() { + return createProjectOperationSettings; + } + + /** Returns the object with the settings used for calls to updateProject. */ + public UnaryCallSettings updateProjectSettings() { + return updateProjectSettings; + } + + /** Returns the object with the settings used for calls to updateProject. */ + public OperationCallSettings + updateProjectOperationSettings() { + return updateProjectOperationSettings; + } + + /** Returns the object with the settings used for calls to moveProject. */ + public UnaryCallSettings moveProjectSettings() { + return moveProjectSettings; + } + + /** Returns the object with the settings used for calls to moveProject. */ + public OperationCallSettings + moveProjectOperationSettings() { + return moveProjectOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteProject. */ + public UnaryCallSettings deleteProjectSettings() { + return deleteProjectSettings; + } + + /** Returns the object with the settings used for calls to deleteProject. */ + public OperationCallSettings + deleteProjectOperationSettings() { + return deleteProjectOperationSettings; + } + + /** Returns the object with the settings used for calls to undeleteProject. */ + public UnaryCallSettings undeleteProjectSettings() { + return undeleteProjectSettings; + } + + /** Returns the object with the settings used for calls to undeleteProject. */ + public OperationCallSettings + undeleteProjectOperationSettings() { + return undeleteProjectOperationSettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ProjectsStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcProjectsStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "cloudresourcemanager.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(ProjectsStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ProjectsStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getProjectSettings = settingsBuilder.getProjectSettings().build(); + listProjectsSettings = settingsBuilder.listProjectsSettings().build(); + searchProjectsSettings = settingsBuilder.searchProjectsSettings().build(); + createProjectSettings = settingsBuilder.createProjectSettings().build(); + createProjectOperationSettings = settingsBuilder.createProjectOperationSettings().build(); + updateProjectSettings = settingsBuilder.updateProjectSettings().build(); + updateProjectOperationSettings = settingsBuilder.updateProjectOperationSettings().build(); + moveProjectSettings = settingsBuilder.moveProjectSettings().build(); + moveProjectOperationSettings = settingsBuilder.moveProjectOperationSettings().build(); + deleteProjectSettings = settingsBuilder.deleteProjectSettings().build(); + deleteProjectOperationSettings = settingsBuilder.deleteProjectOperationSettings().build(); + undeleteProjectSettings = settingsBuilder.undeleteProjectSettings().build(); + undeleteProjectOperationSettings = settingsBuilder.undeleteProjectOperationSettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for ProjectsStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder getProjectSettings; + private final PagedCallSettings.Builder< + ListProjectsRequest, ListProjectsResponse, ListProjectsPagedResponse> + listProjectsSettings; + private final PagedCallSettings.Builder< + SearchProjectsRequest, SearchProjectsResponse, SearchProjectsPagedResponse> + searchProjectsSettings; + private final UnaryCallSettings.Builder createProjectSettings; + private final OperationCallSettings.Builder< + CreateProjectRequest, Project, CreateProjectMetadata> + createProjectOperationSettings; + private final UnaryCallSettings.Builder updateProjectSettings; + private final OperationCallSettings.Builder< + UpdateProjectRequest, Project, UpdateProjectMetadata> + updateProjectOperationSettings; + private final UnaryCallSettings.Builder moveProjectSettings; + private final OperationCallSettings.Builder + moveProjectOperationSettings; + private final UnaryCallSettings.Builder deleteProjectSettings; + private final OperationCallSettings.Builder< + DeleteProjectRequest, Project, DeleteProjectMetadata> + deleteProjectOperationSettings; + private final UnaryCallSettings.Builder + undeleteProjectSettings; + private final OperationCallSettings.Builder< + UndeleteProjectRequest, Project, UndeleteProjectMetadata> + undeleteProjectOperationSettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_1_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listProjectsSettings = PagedCallSettings.newBuilder(LIST_PROJECTS_PAGE_STR_FACT); + searchProjectsSettings = PagedCallSettings.newBuilder(SEARCH_PROJECTS_PAGE_STR_FACT); + createProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createProjectOperationSettings = OperationCallSettings.newBuilder(); + updateProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateProjectOperationSettings = OperationCallSettings.newBuilder(); + moveProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + moveProjectOperationSettings = OperationCallSettings.newBuilder(); + deleteProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteProjectOperationSettings = OperationCallSettings.newBuilder(); + undeleteProjectSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + undeleteProjectOperationSettings = OperationCallSettings.newBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getProjectSettings, + listProjectsSettings, + searchProjectsSettings, + createProjectSettings, + updateProjectSettings, + moveProjectSettings, + deleteProjectSettings, + undeleteProjectSettings, + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(ProjectsStubSettings settings) { + super(settings); + + getProjectSettings = settings.getProjectSettings.toBuilder(); + listProjectsSettings = settings.listProjectsSettings.toBuilder(); + searchProjectsSettings = settings.searchProjectsSettings.toBuilder(); + createProjectSettings = settings.createProjectSettings.toBuilder(); + createProjectOperationSettings = settings.createProjectOperationSettings.toBuilder(); + updateProjectSettings = settings.updateProjectSettings.toBuilder(); + updateProjectOperationSettings = settings.updateProjectOperationSettings.toBuilder(); + moveProjectSettings = settings.moveProjectSettings.toBuilder(); + moveProjectOperationSettings = settings.moveProjectOperationSettings.toBuilder(); + deleteProjectSettings = settings.deleteProjectSettings.toBuilder(); + deleteProjectOperationSettings = settings.deleteProjectOperationSettings.toBuilder(); + undeleteProjectSettings = settings.undeleteProjectSettings.toBuilder(); + undeleteProjectOperationSettings = settings.undeleteProjectOperationSettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getProjectSettings, + listProjectsSettings, + searchProjectsSettings, + createProjectSettings, + updateProjectSettings, + moveProjectSettings, + deleteProjectSettings, + undeleteProjectSettings, + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .getProjectSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listProjectsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .searchProjectsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .createProjectSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateProjectSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .moveProjectSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteProjectSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .undeleteProjectSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createProjectOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Project.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(CreateProjectMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateProjectOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Project.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(UpdateProjectMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .moveProjectOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Project.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(MoveProjectMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteProjectOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Project.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(DeleteProjectMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .undeleteProjectOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Project.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(UndeleteProjectMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to getProject. */ + public UnaryCallSettings.Builder getProjectSettings() { + return getProjectSettings; + } + + /** Returns the builder for the settings used for calls to listProjects. */ + public PagedCallSettings.Builder< + ListProjectsRequest, ListProjectsResponse, ListProjectsPagedResponse> + listProjectsSettings() { + return listProjectsSettings; + } + + /** Returns the builder for the settings used for calls to searchProjects. */ + public PagedCallSettings.Builder< + SearchProjectsRequest, SearchProjectsResponse, SearchProjectsPagedResponse> + searchProjectsSettings() { + return searchProjectsSettings; + } + + /** Returns the builder for the settings used for calls to createProject. */ + public UnaryCallSettings.Builder createProjectSettings() { + return createProjectSettings; + } + + /** Returns the builder for the settings used for calls to createProject. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createProjectOperationSettings() { + return createProjectOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateProject. */ + public UnaryCallSettings.Builder updateProjectSettings() { + return updateProjectSettings; + } + + /** Returns the builder for the settings used for calls to updateProject. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateProjectOperationSettings() { + return updateProjectOperationSettings; + } + + /** Returns the builder for the settings used for calls to moveProject. */ + public UnaryCallSettings.Builder moveProjectSettings() { + return moveProjectSettings; + } + + /** Returns the builder for the settings used for calls to moveProject. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + moveProjectOperationSettings() { + return moveProjectOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteProject. */ + public UnaryCallSettings.Builder deleteProjectSettings() { + return deleteProjectSettings; + } + + /** Returns the builder for the settings used for calls to deleteProject. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteProjectOperationSettings() { + return deleteProjectOperationSettings; + } + + /** Returns the builder for the settings used for calls to undeleteProject. */ + public UnaryCallSettings.Builder undeleteProjectSettings() { + return undeleteProjectSettings; + } + + /** Returns the builder for the settings used for calls to undeleteProject. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + undeleteProjectOperationSettings() { + return undeleteProjectOperationSettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public ProjectsStubSettings build() throws IOException { + return new ProjectsStubSettings(this); + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/TagBindingsStub.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/TagBindingsStub.java new file mode 100644 index 000000000000..aba041c34336 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/TagBindingsStub.java @@ -0,0 +1,78 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3.stub; + +import static com.google.cloud.resourcemanager.v3.TagBindingsClient.ListTagBindingsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata; +import com.google.cloud.resourcemanager.v3.CreateTagBindingRequest; +import com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata; +import com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest; +import com.google.cloud.resourcemanager.v3.ListTagBindingsRequest; +import com.google.cloud.resourcemanager.v3.ListTagBindingsResponse; +import com.google.cloud.resourcemanager.v3.TagBinding; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the TagBindings service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class TagBindingsStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable + listTagBindingsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listTagBindingsPagedCallable()"); + } + + public UnaryCallable listTagBindingsCallable() { + throw new UnsupportedOperationException("Not implemented: listTagBindingsCallable()"); + } + + public OperationCallable + createTagBindingOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createTagBindingOperationCallable()"); + } + + public UnaryCallable createTagBindingCallable() { + throw new UnsupportedOperationException("Not implemented: createTagBindingCallable()"); + } + + public OperationCallable + deleteTagBindingOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteTagBindingOperationCallable()"); + } + + public UnaryCallable deleteTagBindingCallable() { + throw new UnsupportedOperationException("Not implemented: deleteTagBindingCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/TagBindingsStubSettings.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/TagBindingsStubSettings.java new file mode 100644 index 000000000000..e052e0a4b41c --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/TagBindingsStubSettings.java @@ -0,0 +1,503 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3.stub; + +import static com.google.cloud.resourcemanager.v3.TagBindingsClient.ListTagBindingsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata; +import com.google.cloud.resourcemanager.v3.CreateTagBindingRequest; +import com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata; +import com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest; +import com.google.cloud.resourcemanager.v3.ListTagBindingsRequest; +import com.google.cloud.resourcemanager.v3.ListTagBindingsResponse; +import com.google.cloud.resourcemanager.v3.TagBinding; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link TagBindingsStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (cloudresourcemanager.googleapis.com) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of listTagBindings to 30 seconds: + * + *

{@code
+ * TagBindingsStubSettings.Builder tagBindingsSettingsBuilder =
+ *     TagBindingsStubSettings.newBuilder();
+ * tagBindingsSettingsBuilder
+ *     .listTagBindingsSettings()
+ *     .setRetrySettings(
+ *         tagBindingsSettingsBuilder
+ *             .listTagBindingsSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * TagBindingsStubSettings tagBindingsSettings = tagBindingsSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class TagBindingsStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/cloud-platform.read-only") + .build(); + + private final PagedCallSettings< + ListTagBindingsRequest, ListTagBindingsResponse, ListTagBindingsPagedResponse> + listTagBindingsSettings; + private final UnaryCallSettings createTagBindingSettings; + private final OperationCallSettings + createTagBindingOperationSettings; + private final UnaryCallSettings deleteTagBindingSettings; + private final OperationCallSettings + deleteTagBindingOperationSettings; + + private static final PagedListDescriptor< + ListTagBindingsRequest, ListTagBindingsResponse, TagBinding> + LIST_TAG_BINDINGS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListTagBindingsRequest injectToken( + ListTagBindingsRequest payload, String token) { + return ListTagBindingsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListTagBindingsRequest injectPageSize( + ListTagBindingsRequest payload, int pageSize) { + return ListTagBindingsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListTagBindingsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListTagBindingsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListTagBindingsResponse payload) { + return payload.getTagBindingsList() == null + ? ImmutableList.of() + : payload.getTagBindingsList(); + } + }; + + private static final PagedListResponseFactory< + ListTagBindingsRequest, ListTagBindingsResponse, ListTagBindingsPagedResponse> + LIST_TAG_BINDINGS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListTagBindingsRequest, ListTagBindingsResponse, ListTagBindingsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListTagBindingsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_TAG_BINDINGS_PAGE_STR_DESC, request, context); + return ListTagBindingsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listTagBindings. */ + public PagedCallSettings< + ListTagBindingsRequest, ListTagBindingsResponse, ListTagBindingsPagedResponse> + listTagBindingsSettings() { + return listTagBindingsSettings; + } + + /** Returns the object with the settings used for calls to createTagBinding. */ + public UnaryCallSettings createTagBindingSettings() { + return createTagBindingSettings; + } + + /** Returns the object with the settings used for calls to createTagBinding. */ + public OperationCallSettings + createTagBindingOperationSettings() { + return createTagBindingOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteTagBinding. */ + public UnaryCallSettings deleteTagBindingSettings() { + return deleteTagBindingSettings; + } + + /** Returns the object with the settings used for calls to deleteTagBinding. */ + public OperationCallSettings + deleteTagBindingOperationSettings() { + return deleteTagBindingOperationSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public TagBindingsStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcTagBindingsStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "cloudresourcemanager.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(TagBindingsStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected TagBindingsStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listTagBindingsSettings = settingsBuilder.listTagBindingsSettings().build(); + createTagBindingSettings = settingsBuilder.createTagBindingSettings().build(); + createTagBindingOperationSettings = settingsBuilder.createTagBindingOperationSettings().build(); + deleteTagBindingSettings = settingsBuilder.deleteTagBindingSettings().build(); + deleteTagBindingOperationSettings = settingsBuilder.deleteTagBindingOperationSettings().build(); + } + + /** Builder for TagBindingsStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListTagBindingsRequest, ListTagBindingsResponse, ListTagBindingsPagedResponse> + listTagBindingsSettings; + private final UnaryCallSettings.Builder + createTagBindingSettings; + private final OperationCallSettings.Builder< + CreateTagBindingRequest, TagBinding, CreateTagBindingMetadata> + createTagBindingOperationSettings; + private final UnaryCallSettings.Builder + deleteTagBindingSettings; + private final OperationCallSettings.Builder< + DeleteTagBindingRequest, Empty, DeleteTagBindingMetadata> + deleteTagBindingOperationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listTagBindingsSettings = PagedCallSettings.newBuilder(LIST_TAG_BINDINGS_PAGE_STR_FACT); + createTagBindingSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createTagBindingOperationSettings = OperationCallSettings.newBuilder(); + deleteTagBindingSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteTagBindingOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listTagBindingsSettings, createTagBindingSettings, deleteTagBindingSettings); + initDefaults(this); + } + + protected Builder(TagBindingsStubSettings settings) { + super(settings); + + listTagBindingsSettings = settings.listTagBindingsSettings.toBuilder(); + createTagBindingSettings = settings.createTagBindingSettings.toBuilder(); + createTagBindingOperationSettings = settings.createTagBindingOperationSettings.toBuilder(); + deleteTagBindingSettings = settings.deleteTagBindingSettings.toBuilder(); + deleteTagBindingOperationSettings = settings.deleteTagBindingOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listTagBindingsSettings, createTagBindingSettings, deleteTagBindingSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listTagBindingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createTagBindingSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteTagBindingSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .createTagBindingOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(TagBinding.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(CreateTagBindingMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteTagBindingOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(DeleteTagBindingMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listTagBindings. */ + public PagedCallSettings.Builder< + ListTagBindingsRequest, ListTagBindingsResponse, ListTagBindingsPagedResponse> + listTagBindingsSettings() { + return listTagBindingsSettings; + } + + /** Returns the builder for the settings used for calls to createTagBinding. */ + public UnaryCallSettings.Builder + createTagBindingSettings() { + return createTagBindingSettings; + } + + /** Returns the builder for the settings used for calls to createTagBinding. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + CreateTagBindingRequest, TagBinding, CreateTagBindingMetadata> + createTagBindingOperationSettings() { + return createTagBindingOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteTagBinding. */ + public UnaryCallSettings.Builder + deleteTagBindingSettings() { + return deleteTagBindingSettings; + } + + /** Returns the builder for the settings used for calls to deleteTagBinding. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteTagBindingOperationSettings() { + return deleteTagBindingOperationSettings; + } + + @Override + public TagBindingsStubSettings build() throws IOException { + return new TagBindingsStubSettings(this); + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/TagKeysStub.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/TagKeysStub.java new file mode 100644 index 000000000000..7ff01e543c3a --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/TagKeysStub.java @@ -0,0 +1,110 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3.stub; + +import static com.google.cloud.resourcemanager.v3.TagKeysClient.ListTagKeysPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata; +import com.google.cloud.resourcemanager.v3.CreateTagKeyRequest; +import com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata; +import com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest; +import com.google.cloud.resourcemanager.v3.GetTagKeyRequest; +import com.google.cloud.resourcemanager.v3.ListTagKeysRequest; +import com.google.cloud.resourcemanager.v3.ListTagKeysResponse; +import com.google.cloud.resourcemanager.v3.TagKey; +import com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata; +import com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the TagKeys service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class TagKeysStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable listTagKeysPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listTagKeysPagedCallable()"); + } + + public UnaryCallable listTagKeysCallable() { + throw new UnsupportedOperationException("Not implemented: listTagKeysCallable()"); + } + + public UnaryCallable getTagKeyCallable() { + throw new UnsupportedOperationException("Not implemented: getTagKeyCallable()"); + } + + public OperationCallable + createTagKeyOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createTagKeyOperationCallable()"); + } + + public UnaryCallable createTagKeyCallable() { + throw new UnsupportedOperationException("Not implemented: createTagKeyCallable()"); + } + + public OperationCallable + updateTagKeyOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateTagKeyOperationCallable()"); + } + + public UnaryCallable updateTagKeyCallable() { + throw new UnsupportedOperationException("Not implemented: updateTagKeyCallable()"); + } + + public OperationCallable + deleteTagKeyOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteTagKeyOperationCallable()"); + } + + public UnaryCallable deleteTagKeyCallable() { + throw new UnsupportedOperationException("Not implemented: deleteTagKeyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/TagKeysStubSettings.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/TagKeysStubSettings.java new file mode 100644 index 000000000000..222f904a109e --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/TagKeysStubSettings.java @@ -0,0 +1,662 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3.stub; + +import static com.google.cloud.resourcemanager.v3.TagKeysClient.ListTagKeysPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata; +import com.google.cloud.resourcemanager.v3.CreateTagKeyRequest; +import com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata; +import com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest; +import com.google.cloud.resourcemanager.v3.GetTagKeyRequest; +import com.google.cloud.resourcemanager.v3.ListTagKeysRequest; +import com.google.cloud.resourcemanager.v3.ListTagKeysResponse; +import com.google.cloud.resourcemanager.v3.TagKey; +import com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata; +import com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link TagKeysStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (cloudresourcemanager.googleapis.com) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getTagKey to 30 seconds: + * + *

{@code
+ * TagKeysStubSettings.Builder tagKeysSettingsBuilder = TagKeysStubSettings.newBuilder();
+ * tagKeysSettingsBuilder
+ *     .getTagKeySettings()
+ *     .setRetrySettings(
+ *         tagKeysSettingsBuilder
+ *             .getTagKeySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * TagKeysStubSettings tagKeysSettings = tagKeysSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class TagKeysStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/cloud-platform.read-only") + .build(); + + private final PagedCallSettings + listTagKeysSettings; + private final UnaryCallSettings getTagKeySettings; + private final UnaryCallSettings createTagKeySettings; + private final OperationCallSettings + createTagKeyOperationSettings; + private final UnaryCallSettings updateTagKeySettings; + private final OperationCallSettings + updateTagKeyOperationSettings; + private final UnaryCallSettings deleteTagKeySettings; + private final OperationCallSettings + deleteTagKeyOperationSettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_TAG_KEYS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListTagKeysRequest injectToken(ListTagKeysRequest payload, String token) { + return ListTagKeysRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListTagKeysRequest injectPageSize(ListTagKeysRequest payload, int pageSize) { + return ListTagKeysRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListTagKeysRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListTagKeysResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListTagKeysResponse payload) { + return payload.getTagKeysList() == null + ? ImmutableList.of() + : payload.getTagKeysList(); + } + }; + + private static final PagedListResponseFactory< + ListTagKeysRequest, ListTagKeysResponse, ListTagKeysPagedResponse> + LIST_TAG_KEYS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListTagKeysRequest, ListTagKeysResponse, ListTagKeysPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListTagKeysRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_TAG_KEYS_PAGE_STR_DESC, request, context); + return ListTagKeysPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listTagKeys. */ + public PagedCallSettings + listTagKeysSettings() { + return listTagKeysSettings; + } + + /** Returns the object with the settings used for calls to getTagKey. */ + public UnaryCallSettings getTagKeySettings() { + return getTagKeySettings; + } + + /** Returns the object with the settings used for calls to createTagKey. */ + public UnaryCallSettings createTagKeySettings() { + return createTagKeySettings; + } + + /** Returns the object with the settings used for calls to createTagKey. */ + public OperationCallSettings + createTagKeyOperationSettings() { + return createTagKeyOperationSettings; + } + + /** Returns the object with the settings used for calls to updateTagKey. */ + public UnaryCallSettings updateTagKeySettings() { + return updateTagKeySettings; + } + + /** Returns the object with the settings used for calls to updateTagKey. */ + public OperationCallSettings + updateTagKeyOperationSettings() { + return updateTagKeyOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteTagKey. */ + public UnaryCallSettings deleteTagKeySettings() { + return deleteTagKeySettings; + } + + /** Returns the object with the settings used for calls to deleteTagKey. */ + public OperationCallSettings + deleteTagKeyOperationSettings() { + return deleteTagKeyOperationSettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public TagKeysStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcTagKeysStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "cloudresourcemanager.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TagKeysStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected TagKeysStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listTagKeysSettings = settingsBuilder.listTagKeysSettings().build(); + getTagKeySettings = settingsBuilder.getTagKeySettings().build(); + createTagKeySettings = settingsBuilder.createTagKeySettings().build(); + createTagKeyOperationSettings = settingsBuilder.createTagKeyOperationSettings().build(); + updateTagKeySettings = settingsBuilder.updateTagKeySettings().build(); + updateTagKeyOperationSettings = settingsBuilder.updateTagKeyOperationSettings().build(); + deleteTagKeySettings = settingsBuilder.deleteTagKeySettings().build(); + deleteTagKeyOperationSettings = settingsBuilder.deleteTagKeyOperationSettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for TagKeysStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListTagKeysRequest, ListTagKeysResponse, ListTagKeysPagedResponse> + listTagKeysSettings; + private final UnaryCallSettings.Builder getTagKeySettings; + private final UnaryCallSettings.Builder createTagKeySettings; + private final OperationCallSettings.Builder + createTagKeyOperationSettings; + private final UnaryCallSettings.Builder updateTagKeySettings; + private final OperationCallSettings.Builder + updateTagKeyOperationSettings; + private final UnaryCallSettings.Builder deleteTagKeySettings; + private final OperationCallSettings.Builder + deleteTagKeyOperationSettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_1_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listTagKeysSettings = PagedCallSettings.newBuilder(LIST_TAG_KEYS_PAGE_STR_FACT); + getTagKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createTagKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createTagKeyOperationSettings = OperationCallSettings.newBuilder(); + updateTagKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateTagKeyOperationSettings = OperationCallSettings.newBuilder(); + deleteTagKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteTagKeyOperationSettings = OperationCallSettings.newBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listTagKeysSettings, + getTagKeySettings, + createTagKeySettings, + updateTagKeySettings, + deleteTagKeySettings, + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(TagKeysStubSettings settings) { + super(settings); + + listTagKeysSettings = settings.listTagKeysSettings.toBuilder(); + getTagKeySettings = settings.getTagKeySettings.toBuilder(); + createTagKeySettings = settings.createTagKeySettings.toBuilder(); + createTagKeyOperationSettings = settings.createTagKeyOperationSettings.toBuilder(); + updateTagKeySettings = settings.updateTagKeySettings.toBuilder(); + updateTagKeyOperationSettings = settings.updateTagKeyOperationSettings.toBuilder(); + deleteTagKeySettings = settings.deleteTagKeySettings.toBuilder(); + deleteTagKeyOperationSettings = settings.deleteTagKeyOperationSettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listTagKeysSettings, + getTagKeySettings, + createTagKeySettings, + updateTagKeySettings, + deleteTagKeySettings, + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listTagKeysSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getTagKeySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createTagKeySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateTagKeySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteTagKeySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createTagKeyOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(TagKey.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(CreateTagKeyMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateTagKeyOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(TagKey.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(UpdateTagKeyMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteTagKeyOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(TagKey.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(DeleteTagKeyMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listTagKeys. */ + public PagedCallSettings.Builder< + ListTagKeysRequest, ListTagKeysResponse, ListTagKeysPagedResponse> + listTagKeysSettings() { + return listTagKeysSettings; + } + + /** Returns the builder for the settings used for calls to getTagKey. */ + public UnaryCallSettings.Builder getTagKeySettings() { + return getTagKeySettings; + } + + /** Returns the builder for the settings used for calls to createTagKey. */ + public UnaryCallSettings.Builder createTagKeySettings() { + return createTagKeySettings; + } + + /** Returns the builder for the settings used for calls to createTagKey. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createTagKeyOperationSettings() { + return createTagKeyOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateTagKey. */ + public UnaryCallSettings.Builder updateTagKeySettings() { + return updateTagKeySettings; + } + + /** Returns the builder for the settings used for calls to updateTagKey. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateTagKeyOperationSettings() { + return updateTagKeyOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteTagKey. */ + public UnaryCallSettings.Builder deleteTagKeySettings() { + return deleteTagKeySettings; + } + + /** Returns the builder for the settings used for calls to deleteTagKey. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteTagKeyOperationSettings() { + return deleteTagKeyOperationSettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public TagKeysStubSettings build() throws IOException { + return new TagKeysStubSettings(this); + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/TagValuesStub.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/TagValuesStub.java new file mode 100644 index 000000000000..a61d24c44d33 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/TagValuesStub.java @@ -0,0 +1,111 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3.stub; + +import static com.google.cloud.resourcemanager.v3.TagValuesClient.ListTagValuesPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.resourcemanager.v3.CreateTagValueMetadata; +import com.google.cloud.resourcemanager.v3.CreateTagValueRequest; +import com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata; +import com.google.cloud.resourcemanager.v3.DeleteTagValueRequest; +import com.google.cloud.resourcemanager.v3.GetTagValueRequest; +import com.google.cloud.resourcemanager.v3.ListTagValuesRequest; +import com.google.cloud.resourcemanager.v3.ListTagValuesResponse; +import com.google.cloud.resourcemanager.v3.TagValue; +import com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata; +import com.google.cloud.resourcemanager.v3.UpdateTagValueRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the TagValues service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class TagValuesStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable + listTagValuesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listTagValuesPagedCallable()"); + } + + public UnaryCallable listTagValuesCallable() { + throw new UnsupportedOperationException("Not implemented: listTagValuesCallable()"); + } + + public UnaryCallable getTagValueCallable() { + throw new UnsupportedOperationException("Not implemented: getTagValueCallable()"); + } + + public OperationCallable + createTagValueOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createTagValueOperationCallable()"); + } + + public UnaryCallable createTagValueCallable() { + throw new UnsupportedOperationException("Not implemented: createTagValueCallable()"); + } + + public OperationCallable + updateTagValueOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateTagValueOperationCallable()"); + } + + public UnaryCallable updateTagValueCallable() { + throw new UnsupportedOperationException("Not implemented: updateTagValueCallable()"); + } + + public OperationCallable + deleteTagValueOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteTagValueOperationCallable()"); + } + + public UnaryCallable deleteTagValueCallable() { + throw new UnsupportedOperationException("Not implemented: deleteTagValueCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/TagValuesStubSettings.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/TagValuesStubSettings.java new file mode 100644 index 000000000000..7a4f24188c5a --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/stub/TagValuesStubSettings.java @@ -0,0 +1,669 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3.stub; + +import static com.google.cloud.resourcemanager.v3.TagValuesClient.ListTagValuesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.resourcemanager.v3.CreateTagValueMetadata; +import com.google.cloud.resourcemanager.v3.CreateTagValueRequest; +import com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata; +import com.google.cloud.resourcemanager.v3.DeleteTagValueRequest; +import com.google.cloud.resourcemanager.v3.GetTagValueRequest; +import com.google.cloud.resourcemanager.v3.ListTagValuesRequest; +import com.google.cloud.resourcemanager.v3.ListTagValuesResponse; +import com.google.cloud.resourcemanager.v3.TagValue; +import com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata; +import com.google.cloud.resourcemanager.v3.UpdateTagValueRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link TagValuesStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (cloudresourcemanager.googleapis.com) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getTagValue to 30 seconds: + * + *

{@code
+ * TagValuesStubSettings.Builder tagValuesSettingsBuilder = TagValuesStubSettings.newBuilder();
+ * tagValuesSettingsBuilder
+ *     .getTagValueSettings()
+ *     .setRetrySettings(
+ *         tagValuesSettingsBuilder
+ *             .getTagValueSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * TagValuesStubSettings tagValuesSettings = tagValuesSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class TagValuesStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/cloud-platform.read-only") + .build(); + + private final PagedCallSettings< + ListTagValuesRequest, ListTagValuesResponse, ListTagValuesPagedResponse> + listTagValuesSettings; + private final UnaryCallSettings getTagValueSettings; + private final UnaryCallSettings createTagValueSettings; + private final OperationCallSettings + createTagValueOperationSettings; + private final UnaryCallSettings updateTagValueSettings; + private final OperationCallSettings + updateTagValueOperationSettings; + private final UnaryCallSettings deleteTagValueSettings; + private final OperationCallSettings + deleteTagValueOperationSettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_TAG_VALUES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListTagValuesRequest injectToken(ListTagValuesRequest payload, String token) { + return ListTagValuesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListTagValuesRequest injectPageSize(ListTagValuesRequest payload, int pageSize) { + return ListTagValuesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListTagValuesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListTagValuesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListTagValuesResponse payload) { + return payload.getTagValuesList() == null + ? ImmutableList.of() + : payload.getTagValuesList(); + } + }; + + private static final PagedListResponseFactory< + ListTagValuesRequest, ListTagValuesResponse, ListTagValuesPagedResponse> + LIST_TAG_VALUES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListTagValuesRequest, ListTagValuesResponse, ListTagValuesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListTagValuesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_TAG_VALUES_PAGE_STR_DESC, request, context); + return ListTagValuesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listTagValues. */ + public PagedCallSettings + listTagValuesSettings() { + return listTagValuesSettings; + } + + /** Returns the object with the settings used for calls to getTagValue. */ + public UnaryCallSettings getTagValueSettings() { + return getTagValueSettings; + } + + /** Returns the object with the settings used for calls to createTagValue. */ + public UnaryCallSettings createTagValueSettings() { + return createTagValueSettings; + } + + /** Returns the object with the settings used for calls to createTagValue. */ + public OperationCallSettings + createTagValueOperationSettings() { + return createTagValueOperationSettings; + } + + /** Returns the object with the settings used for calls to updateTagValue. */ + public UnaryCallSettings updateTagValueSettings() { + return updateTagValueSettings; + } + + /** Returns the object with the settings used for calls to updateTagValue. */ + public OperationCallSettings + updateTagValueOperationSettings() { + return updateTagValueOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteTagValue. */ + public UnaryCallSettings deleteTagValueSettings() { + return deleteTagValueSettings; + } + + /** Returns the object with the settings used for calls to deleteTagValue. */ + public OperationCallSettings + deleteTagValueOperationSettings() { + return deleteTagValueOperationSettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public TagValuesStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcTagValuesStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "cloudresourcemanager.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TagValuesStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected TagValuesStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listTagValuesSettings = settingsBuilder.listTagValuesSettings().build(); + getTagValueSettings = settingsBuilder.getTagValueSettings().build(); + createTagValueSettings = settingsBuilder.createTagValueSettings().build(); + createTagValueOperationSettings = settingsBuilder.createTagValueOperationSettings().build(); + updateTagValueSettings = settingsBuilder.updateTagValueSettings().build(); + updateTagValueOperationSettings = settingsBuilder.updateTagValueOperationSettings().build(); + deleteTagValueSettings = settingsBuilder.deleteTagValueSettings().build(); + deleteTagValueOperationSettings = settingsBuilder.deleteTagValueOperationSettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for TagValuesStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListTagValuesRequest, ListTagValuesResponse, ListTagValuesPagedResponse> + listTagValuesSettings; + private final UnaryCallSettings.Builder getTagValueSettings; + private final UnaryCallSettings.Builder + createTagValueSettings; + private final OperationCallSettings.Builder< + CreateTagValueRequest, TagValue, CreateTagValueMetadata> + createTagValueOperationSettings; + private final UnaryCallSettings.Builder + updateTagValueSettings; + private final OperationCallSettings.Builder< + UpdateTagValueRequest, TagValue, UpdateTagValueMetadata> + updateTagValueOperationSettings; + private final UnaryCallSettings.Builder + deleteTagValueSettings; + private final OperationCallSettings.Builder< + DeleteTagValueRequest, TagValue, DeleteTagValueMetadata> + deleteTagValueOperationSettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_1_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listTagValuesSettings = PagedCallSettings.newBuilder(LIST_TAG_VALUES_PAGE_STR_FACT); + getTagValueSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createTagValueSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createTagValueOperationSettings = OperationCallSettings.newBuilder(); + updateTagValueSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateTagValueOperationSettings = OperationCallSettings.newBuilder(); + deleteTagValueSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteTagValueOperationSettings = OperationCallSettings.newBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listTagValuesSettings, + getTagValueSettings, + createTagValueSettings, + updateTagValueSettings, + deleteTagValueSettings, + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(TagValuesStubSettings settings) { + super(settings); + + listTagValuesSettings = settings.listTagValuesSettings.toBuilder(); + getTagValueSettings = settings.getTagValueSettings.toBuilder(); + createTagValueSettings = settings.createTagValueSettings.toBuilder(); + createTagValueOperationSettings = settings.createTagValueOperationSettings.toBuilder(); + updateTagValueSettings = settings.updateTagValueSettings.toBuilder(); + updateTagValueOperationSettings = settings.updateTagValueOperationSettings.toBuilder(); + deleteTagValueSettings = settings.deleteTagValueSettings.toBuilder(); + deleteTagValueOperationSettings = settings.deleteTagValueOperationSettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listTagValuesSettings, + getTagValueSettings, + createTagValueSettings, + updateTagValueSettings, + deleteTagValueSettings, + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listTagValuesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getTagValueSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createTagValueSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateTagValueSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteTagValueSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createTagValueOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(TagValue.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(CreateTagValueMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateTagValueOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(TagValue.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(UpdateTagValueMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteTagValueOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(TagValue.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(DeleteTagValueMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listTagValues. */ + public PagedCallSettings.Builder< + ListTagValuesRequest, ListTagValuesResponse, ListTagValuesPagedResponse> + listTagValuesSettings() { + return listTagValuesSettings; + } + + /** Returns the builder for the settings used for calls to getTagValue. */ + public UnaryCallSettings.Builder getTagValueSettings() { + return getTagValueSettings; + } + + /** Returns the builder for the settings used for calls to createTagValue. */ + public UnaryCallSettings.Builder createTagValueSettings() { + return createTagValueSettings; + } + + /** Returns the builder for the settings used for calls to createTagValue. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createTagValueOperationSettings() { + return createTagValueOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateTagValue. */ + public UnaryCallSettings.Builder updateTagValueSettings() { + return updateTagValueSettings; + } + + /** Returns the builder for the settings used for calls to updateTagValue. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateTagValueOperationSettings() { + return updateTagValueOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteTagValue. */ + public UnaryCallSettings.Builder deleteTagValueSettings() { + return deleteTagValueSettings; + } + + /** Returns the builder for the settings used for calls to deleteTagValue. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteTagValueOperationSettings() { + return deleteTagValueOperationSettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public TagValuesStubSettings build() throws IOException { + return new TagValuesStubSettings(this); + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/FoldersClientTest.java b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/FoldersClientTest.java new file mode 100644 index 000000000000..6164509658b8 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/FoldersClientTest.java @@ -0,0 +1,1095 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import static com.google.cloud.resourcemanager.v3.FoldersClient.ListFoldersPagedResponse; +import static com.google.cloud.resourcemanager.v3.FoldersClient.SearchFoldersPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.resourcenames.ResourceName; +import com.google.common.collect.Lists; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class FoldersClientTest { + private static MockFolders mockFolders; + private static MockServiceHelper mockServiceHelper; + private FoldersClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockFolders = new MockFolders(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockFolders)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + FoldersSettings settings = + FoldersSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = FoldersClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void getFolderTest() throws Exception { + Folder expectedResponse = + Folder.newBuilder() + .setName(FolderName.of("[FOLDER]").toString()) + .setParent("parent-995424086") + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + mockFolders.addResponse(expectedResponse); + + FolderName name = FolderName.of("[FOLDER]"); + + Folder actualResponse = client.getFolder(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFolders.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetFolderRequest actualRequest = ((GetFolderRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getFolderExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFolders.addException(exception); + + try { + FolderName name = FolderName.of("[FOLDER]"); + client.getFolder(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getFolderTest2() throws Exception { + Folder expectedResponse = + Folder.newBuilder() + .setName(FolderName.of("[FOLDER]").toString()) + .setParent("parent-995424086") + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + mockFolders.addResponse(expectedResponse); + + String name = "name3373707"; + + Folder actualResponse = client.getFolder(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFolders.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetFolderRequest actualRequest = ((GetFolderRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getFolderExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFolders.addException(exception); + + try { + String name = "name3373707"; + client.getFolder(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listFoldersTest() throws Exception { + Folder responsesElement = Folder.newBuilder().build(); + ListFoldersResponse expectedResponse = + ListFoldersResponse.newBuilder() + .setNextPageToken("") + .addAllFolders(Arrays.asList(responsesElement)) + .build(); + mockFolders.addResponse(expectedResponse); + + ResourceName parent = TagValueName.of("[TAG_VALUE]"); + + ListFoldersPagedResponse pagedListResponse = client.listFolders(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getFoldersList().get(0), resources.get(0)); + + List actualRequests = mockFolders.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListFoldersRequest actualRequest = ((ListFoldersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listFoldersExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFolders.addException(exception); + + try { + ResourceName parent = TagValueName.of("[TAG_VALUE]"); + client.listFolders(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listFoldersTest2() throws Exception { + Folder responsesElement = Folder.newBuilder().build(); + ListFoldersResponse expectedResponse = + ListFoldersResponse.newBuilder() + .setNextPageToken("") + .addAllFolders(Arrays.asList(responsesElement)) + .build(); + mockFolders.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListFoldersPagedResponse pagedListResponse = client.listFolders(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getFoldersList().get(0), resources.get(0)); + + List actualRequests = mockFolders.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListFoldersRequest actualRequest = ((ListFoldersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listFoldersExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFolders.addException(exception); + + try { + String parent = "parent-995424086"; + client.listFolders(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchFoldersTest() throws Exception { + Folder responsesElement = Folder.newBuilder().build(); + SearchFoldersResponse expectedResponse = + SearchFoldersResponse.newBuilder() + .setNextPageToken("") + .addAllFolders(Arrays.asList(responsesElement)) + .build(); + mockFolders.addResponse(expectedResponse); + + String query = "query107944136"; + + SearchFoldersPagedResponse pagedListResponse = client.searchFolders(query); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getFoldersList().get(0), resources.get(0)); + + List actualRequests = mockFolders.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchFoldersRequest actualRequest = ((SearchFoldersRequest) actualRequests.get(0)); + + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchFoldersExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFolders.addException(exception); + + try { + String query = "query107944136"; + client.searchFolders(query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createFolderTest() throws Exception { + Folder expectedResponse = + Folder.newBuilder() + .setName(FolderName.of("[FOLDER]").toString()) + .setParent("parent-995424086") + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createFolderTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFolders.addResponse(resultOperation); + + Folder folder = Folder.newBuilder().build(); + + Folder actualResponse = client.createFolderAsync(folder).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFolders.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateFolderRequest actualRequest = ((CreateFolderRequest) actualRequests.get(0)); + + Assert.assertEquals(folder, actualRequest.getFolder()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createFolderExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFolders.addException(exception); + + try { + Folder folder = Folder.newBuilder().build(); + client.createFolderAsync(folder).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateFolderTest() throws Exception { + Folder expectedResponse = + Folder.newBuilder() + .setName(FolderName.of("[FOLDER]").toString()) + .setParent("parent-995424086") + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateFolderTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFolders.addResponse(resultOperation); + + Folder folder = Folder.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Folder actualResponse = client.updateFolderAsync(folder, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFolders.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateFolderRequest actualRequest = ((UpdateFolderRequest) actualRequests.get(0)); + + Assert.assertEquals(folder, actualRequest.getFolder()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateFolderExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFolders.addException(exception); + + try { + Folder folder = Folder.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateFolderAsync(folder, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void moveFolderTest() throws Exception { + Folder expectedResponse = + Folder.newBuilder() + .setName(FolderName.of("[FOLDER]").toString()) + .setParent("parent-995424086") + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("moveFolderTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFolders.addResponse(resultOperation); + + FolderName name = FolderName.of("[FOLDER]"); + ResourceName destinationParent = TagValueName.of("[TAG_VALUE]"); + + Folder actualResponse = client.moveFolderAsync(name, destinationParent).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFolders.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MoveFolderRequest actualRequest = ((MoveFolderRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(destinationParent.toString(), actualRequest.getDestinationParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void moveFolderExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFolders.addException(exception); + + try { + FolderName name = FolderName.of("[FOLDER]"); + ResourceName destinationParent = TagValueName.of("[TAG_VALUE]"); + client.moveFolderAsync(name, destinationParent).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void moveFolderTest2() throws Exception { + Folder expectedResponse = + Folder.newBuilder() + .setName(FolderName.of("[FOLDER]").toString()) + .setParent("parent-995424086") + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("moveFolderTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFolders.addResponse(resultOperation); + + FolderName name = FolderName.of("[FOLDER]"); + String destinationParent = "destinationParent-1733659048"; + + Folder actualResponse = client.moveFolderAsync(name, destinationParent).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFolders.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MoveFolderRequest actualRequest = ((MoveFolderRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(destinationParent, actualRequest.getDestinationParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void moveFolderExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFolders.addException(exception); + + try { + FolderName name = FolderName.of("[FOLDER]"); + String destinationParent = "destinationParent-1733659048"; + client.moveFolderAsync(name, destinationParent).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void moveFolderTest3() throws Exception { + Folder expectedResponse = + Folder.newBuilder() + .setName(FolderName.of("[FOLDER]").toString()) + .setParent("parent-995424086") + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("moveFolderTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFolders.addResponse(resultOperation); + + String name = "name3373707"; + ResourceName destinationParent = TagValueName.of("[TAG_VALUE]"); + + Folder actualResponse = client.moveFolderAsync(name, destinationParent).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFolders.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MoveFolderRequest actualRequest = ((MoveFolderRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(destinationParent.toString(), actualRequest.getDestinationParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void moveFolderExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFolders.addException(exception); + + try { + String name = "name3373707"; + ResourceName destinationParent = TagValueName.of("[TAG_VALUE]"); + client.moveFolderAsync(name, destinationParent).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void moveFolderTest4() throws Exception { + Folder expectedResponse = + Folder.newBuilder() + .setName(FolderName.of("[FOLDER]").toString()) + .setParent("parent-995424086") + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("moveFolderTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFolders.addResponse(resultOperation); + + String name = "name3373707"; + String destinationParent = "destinationParent-1733659048"; + + Folder actualResponse = client.moveFolderAsync(name, destinationParent).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFolders.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MoveFolderRequest actualRequest = ((MoveFolderRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(destinationParent, actualRequest.getDestinationParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void moveFolderExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFolders.addException(exception); + + try { + String name = "name3373707"; + String destinationParent = "destinationParent-1733659048"; + client.moveFolderAsync(name, destinationParent).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteFolderTest() throws Exception { + Folder expectedResponse = + Folder.newBuilder() + .setName(FolderName.of("[FOLDER]").toString()) + .setParent("parent-995424086") + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteFolderTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFolders.addResponse(resultOperation); + + FolderName name = FolderName.of("[FOLDER]"); + + Folder actualResponse = client.deleteFolderAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFolders.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteFolderRequest actualRequest = ((DeleteFolderRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteFolderExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFolders.addException(exception); + + try { + FolderName name = FolderName.of("[FOLDER]"); + client.deleteFolderAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteFolderTest2() throws Exception { + Folder expectedResponse = + Folder.newBuilder() + .setName(FolderName.of("[FOLDER]").toString()) + .setParent("parent-995424086") + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteFolderTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFolders.addResponse(resultOperation); + + String name = "name3373707"; + + Folder actualResponse = client.deleteFolderAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFolders.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteFolderRequest actualRequest = ((DeleteFolderRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteFolderExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFolders.addException(exception); + + try { + String name = "name3373707"; + client.deleteFolderAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void undeleteFolderTest() throws Exception { + Folder expectedResponse = + Folder.newBuilder() + .setName(FolderName.of("[FOLDER]").toString()) + .setParent("parent-995424086") + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("undeleteFolderTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFolders.addResponse(resultOperation); + + FolderName name = FolderName.of("[FOLDER]"); + + Folder actualResponse = client.undeleteFolderAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFolders.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UndeleteFolderRequest actualRequest = ((UndeleteFolderRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void undeleteFolderExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFolders.addException(exception); + + try { + FolderName name = FolderName.of("[FOLDER]"); + client.undeleteFolderAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void undeleteFolderTest2() throws Exception { + Folder expectedResponse = + Folder.newBuilder() + .setName(FolderName.of("[FOLDER]").toString()) + .setParent("parent-995424086") + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("undeleteFolderTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFolders.addResponse(resultOperation); + + String name = "name3373707"; + + Folder actualResponse = client.undeleteFolderAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFolders.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UndeleteFolderRequest actualRequest = ((UndeleteFolderRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void undeleteFolderExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFolders.addException(exception); + + try { + String name = "name3373707"; + client.undeleteFolderAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockFolders.addResponse(expectedResponse); + + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + + Policy actualResponse = client.getIamPolicy(resource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFolders.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource.toString(), actualRequest.getResource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFolders.addException(exception); + + try { + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + client.getIamPolicy(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest2() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockFolders.addResponse(expectedResponse); + + String resource = "resource-341064690"; + + Policy actualResponse = client.getIamPolicy(resource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFolders.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFolders.addException(exception); + + try { + String resource = "resource-341064690"; + client.getIamPolicy(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockFolders.addResponse(expectedResponse); + + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + Policy policy = Policy.newBuilder().build(); + + Policy actualResponse = client.setIamPolicy(resource, policy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFolders.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource.toString(), actualRequest.getResource()); + Assert.assertEquals(policy, actualRequest.getPolicy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFolders.addException(exception); + + try { + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + Policy policy = Policy.newBuilder().build(); + client.setIamPolicy(resource, policy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest2() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockFolders.addResponse(expectedResponse); + + String resource = "resource-341064690"; + Policy policy = Policy.newBuilder().build(); + + Policy actualResponse = client.setIamPolicy(resource, policy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFolders.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertEquals(policy, actualRequest.getPolicy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFolders.addException(exception); + + try { + String resource = "resource-341064690"; + Policy policy = Policy.newBuilder().build(); + client.setIamPolicy(resource, policy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockFolders.addResponse(expectedResponse); + + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + List permissions = new ArrayList<>(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFolders.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(resource.toString(), actualRequest.getResource()); + Assert.assertEquals(permissions, actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFolders.addException(exception); + + try { + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + List permissions = new ArrayList<>(); + client.testIamPermissions(resource, permissions); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest2() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockFolders.addResponse(expectedResponse); + + String resource = "resource-341064690"; + List permissions = new ArrayList<>(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFolders.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertEquals(permissions, actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFolders.addException(exception); + + try { + String resource = "resource-341064690"; + List permissions = new ArrayList<>(); + client.testIamPermissions(resource, permissions); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockFolders.java b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockFolders.java new file mode 100644 index 000000000000..8ad2d006663a --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockFolders.java @@ -0,0 +1,59 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockFolders implements MockGrpcService { + private final MockFoldersImpl serviceImpl; + + public MockFolders() { + serviceImpl = new MockFoldersImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockFoldersImpl.java b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockFoldersImpl.java new file mode 100644 index 000000000000..338aa658a7a7 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockFoldersImpl.java @@ -0,0 +1,294 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import com.google.api.core.BetaApi; +import com.google.cloud.resourcemanager.v3.FoldersGrpc.FoldersImplBase; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockFoldersImpl extends FoldersImplBase { + private List requests; + private Queue responses; + + public MockFoldersImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void getFolder(GetFolderRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Folder) { + requests.add(request); + responseObserver.onNext(((Folder) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetFolder, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Folder.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listFolders( + ListFoldersRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListFoldersResponse) { + requests.add(request); + responseObserver.onNext(((ListFoldersResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListFolders, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListFoldersResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void searchFolders( + SearchFoldersRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SearchFoldersResponse) { + requests.add(request); + responseObserver.onNext(((SearchFoldersResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SearchFolders, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SearchFoldersResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createFolder( + CreateFolderRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateFolder, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateFolder( + UpdateFolderRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateFolder, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void moveFolder(MoveFolderRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method MoveFolder, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteFolder( + DeleteFolderRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteFolder, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void undeleteFolder( + UndeleteFolderRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UndeleteFolder, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext(((TestIamPermissionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockOrganizations.java b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockOrganizations.java new file mode 100644 index 000000000000..2fc23121716d --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockOrganizations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockOrganizations implements MockGrpcService { + private final MockOrganizationsImpl serviceImpl; + + public MockOrganizations() { + serviceImpl = new MockOrganizationsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockOrganizationsImpl.java b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockOrganizationsImpl.java new file mode 100644 index 000000000000..d504273b1268 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockOrganizationsImpl.java @@ -0,0 +1,170 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import com.google.api.core.BetaApi; +import com.google.cloud.resourcemanager.v3.OrganizationsGrpc.OrganizationsImplBase; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockOrganizationsImpl extends OrganizationsImplBase { + private List requests; + private Queue responses; + + public MockOrganizationsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void getOrganization( + GetOrganizationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Organization) { + requests.add(request); + responseObserver.onNext(((Organization) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetOrganization, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Organization.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void searchOrganizations( + SearchOrganizationsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SearchOrganizationsResponse) { + requests.add(request); + responseObserver.onNext(((SearchOrganizationsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SearchOrganizations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SearchOrganizationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext(((TestIamPermissionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockProjects.java b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockProjects.java new file mode 100644 index 000000000000..5b828da6ebbd --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockProjects.java @@ -0,0 +1,59 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockProjects implements MockGrpcService { + private final MockProjectsImpl serviceImpl; + + public MockProjects() { + serviceImpl = new MockProjectsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockProjectsImpl.java b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockProjectsImpl.java new file mode 100644 index 000000000000..f8dd1f933f3a --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockProjectsImpl.java @@ -0,0 +1,294 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import com.google.api.core.BetaApi; +import com.google.cloud.resourcemanager.v3.ProjectsGrpc.ProjectsImplBase; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockProjectsImpl extends ProjectsImplBase { + private List requests; + private Queue responses; + + public MockProjectsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void getProject(GetProjectRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Project) { + requests.add(request); + responseObserver.onNext(((Project) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetProject, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Project.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listProjects( + ListProjectsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListProjectsResponse) { + requests.add(request); + responseObserver.onNext(((ListProjectsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListProjects, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListProjectsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void searchProjects( + SearchProjectsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SearchProjectsResponse) { + requests.add(request); + responseObserver.onNext(((SearchProjectsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SearchProjects, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SearchProjectsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createProject( + CreateProjectRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateProject, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateProject( + UpdateProjectRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateProject, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void moveProject(MoveProjectRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method MoveProject, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteProject( + DeleteProjectRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteProject, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void undeleteProject( + UndeleteProjectRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UndeleteProject, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext(((TestIamPermissionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockTagBindings.java b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockTagBindings.java new file mode 100644 index 000000000000..8a5f1348d999 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockTagBindings.java @@ -0,0 +1,59 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockTagBindings implements MockGrpcService { + private final MockTagBindingsImpl serviceImpl; + + public MockTagBindings() { + serviceImpl = new MockTagBindingsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockTagBindingsImpl.java b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockTagBindingsImpl.java new file mode 100644 index 000000000000..fbb95027ba21 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockTagBindingsImpl.java @@ -0,0 +1,124 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import com.google.api.core.BetaApi; +import com.google.cloud.resourcemanager.v3.TagBindingsGrpc.TagBindingsImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockTagBindingsImpl extends TagBindingsImplBase { + private List requests; + private Queue responses; + + public MockTagBindingsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listTagBindings( + ListTagBindingsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListTagBindingsResponse) { + requests.add(request); + responseObserver.onNext(((ListTagBindingsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListTagBindings, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListTagBindingsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createTagBinding( + CreateTagBindingRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateTagBinding, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteTagBinding( + DeleteTagBindingRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteTagBinding, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockTagKeys.java b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockTagKeys.java new file mode 100644 index 000000000000..6f2931cdaa32 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockTagKeys.java @@ -0,0 +1,59 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockTagKeys implements MockGrpcService { + private final MockTagKeysImpl serviceImpl; + + public MockTagKeys() { + serviceImpl = new MockTagKeysImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockTagKeysImpl.java b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockTagKeysImpl.java new file mode 100644 index 000000000000..5cda3333f313 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockTagKeysImpl.java @@ -0,0 +1,232 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import com.google.api.core.BetaApi; +import com.google.cloud.resourcemanager.v3.TagKeysGrpc.TagKeysImplBase; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockTagKeysImpl extends TagKeysImplBase { + private List requests; + private Queue responses; + + public MockTagKeysImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listTagKeys( + ListTagKeysRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListTagKeysResponse) { + requests.add(request); + responseObserver.onNext(((ListTagKeysResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListTagKeys, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListTagKeysResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getTagKey(GetTagKeyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TagKey) { + requests.add(request); + responseObserver.onNext(((TagKey) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetTagKey, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TagKey.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createTagKey( + CreateTagKeyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateTagKey, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateTagKey( + UpdateTagKeyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateTagKey, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteTagKey( + DeleteTagKeyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteTagKey, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext(((TestIamPermissionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockTagValues.java b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockTagValues.java new file mode 100644 index 000000000000..fcc193a46d5c --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockTagValues.java @@ -0,0 +1,59 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockTagValues implements MockGrpcService { + private final MockTagValuesImpl serviceImpl; + + public MockTagValues() { + serviceImpl = new MockTagValuesImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockTagValuesImpl.java b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockTagValuesImpl.java new file mode 100644 index 000000000000..a4a9ca4a291e --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/MockTagValuesImpl.java @@ -0,0 +1,232 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import com.google.api.core.BetaApi; +import com.google.cloud.resourcemanager.v3.TagValuesGrpc.TagValuesImplBase; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockTagValuesImpl extends TagValuesImplBase { + private List requests; + private Queue responses; + + public MockTagValuesImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listTagValues( + ListTagValuesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListTagValuesResponse) { + requests.add(request); + responseObserver.onNext(((ListTagValuesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListTagValues, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListTagValuesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getTagValue(GetTagValueRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TagValue) { + requests.add(request); + responseObserver.onNext(((TagValue) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetTagValue, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TagValue.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createTagValue( + CreateTagValueRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateTagValue, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateTagValue( + UpdateTagValueRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateTagValue, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteTagValue( + DeleteTagValueRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteTagValue, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext(((TestIamPermissionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/OrganizationsClientTest.java b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/OrganizationsClientTest.java new file mode 100644 index 000000000000..4190d16af574 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/OrganizationsClientTest.java @@ -0,0 +1,458 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import static com.google.cloud.resourcemanager.v3.OrganizationsClient.SearchOrganizationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.resourcenames.ResourceName; +import com.google.common.collect.Lists; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.ByteString; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class OrganizationsClientTest { + private static MockServiceHelper mockServiceHelper; + private OrganizationsClient client; + private static MockOrganizations mockOrganizations; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockOrganizations = new MockOrganizations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockOrganizations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + OrganizationsSettings settings = + OrganizationsSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = OrganizationsClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void getOrganizationTest() throws Exception { + Organization expectedResponse = + Organization.newBuilder() + .setName(OrganizationName.of("[ORGANIZATION]").toString()) + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + mockOrganizations.addResponse(expectedResponse); + + OrganizationName name = OrganizationName.of("[ORGANIZATION]"); + + Organization actualResponse = client.getOrganization(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOrganizations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetOrganizationRequest actualRequest = ((GetOrganizationRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getOrganizationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOrganizations.addException(exception); + + try { + OrganizationName name = OrganizationName.of("[ORGANIZATION]"); + client.getOrganization(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getOrganizationTest2() throws Exception { + Organization expectedResponse = + Organization.newBuilder() + .setName(OrganizationName.of("[ORGANIZATION]").toString()) + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + mockOrganizations.addResponse(expectedResponse); + + String name = "name3373707"; + + Organization actualResponse = client.getOrganization(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOrganizations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetOrganizationRequest actualRequest = ((GetOrganizationRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getOrganizationExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOrganizations.addException(exception); + + try { + String name = "name3373707"; + client.getOrganization(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchOrganizationsTest() throws Exception { + Organization responsesElement = Organization.newBuilder().build(); + SearchOrganizationsResponse expectedResponse = + SearchOrganizationsResponse.newBuilder() + .setNextPageToken("") + .addAllOrganizations(Arrays.asList(responsesElement)) + .build(); + mockOrganizations.addResponse(expectedResponse); + + String query = "query107944136"; + + SearchOrganizationsPagedResponse pagedListResponse = client.searchOrganizations(query); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getOrganizationsList().get(0), resources.get(0)); + + List actualRequests = mockOrganizations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchOrganizationsRequest actualRequest = ((SearchOrganizationsRequest) actualRequests.get(0)); + + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchOrganizationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOrganizations.addException(exception); + + try { + String query = "query107944136"; + client.searchOrganizations(query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockOrganizations.addResponse(expectedResponse); + + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + + Policy actualResponse = client.getIamPolicy(resource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOrganizations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource.toString(), actualRequest.getResource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOrganizations.addException(exception); + + try { + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + client.getIamPolicy(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest2() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockOrganizations.addResponse(expectedResponse); + + String resource = "resource-341064690"; + + Policy actualResponse = client.getIamPolicy(resource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOrganizations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOrganizations.addException(exception); + + try { + String resource = "resource-341064690"; + client.getIamPolicy(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockOrganizations.addResponse(expectedResponse); + + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + + Policy actualResponse = client.setIamPolicy(resource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOrganizations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource.toString(), actualRequest.getResource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOrganizations.addException(exception); + + try { + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + client.setIamPolicy(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest2() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockOrganizations.addResponse(expectedResponse); + + String resource = "resource-341064690"; + + Policy actualResponse = client.setIamPolicy(resource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOrganizations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOrganizations.addException(exception); + + try { + String resource = "resource-341064690"; + client.setIamPolicy(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockOrganizations.addResponse(expectedResponse); + + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + List permissions = new ArrayList<>(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOrganizations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(resource.toString(), actualRequest.getResource()); + Assert.assertEquals(permissions, actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOrganizations.addException(exception); + + try { + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + List permissions = new ArrayList<>(); + client.testIamPermissions(resource, permissions); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest2() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockOrganizations.addResponse(expectedResponse); + + String resource = "resource-341064690"; + List permissions = new ArrayList<>(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOrganizations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertEquals(permissions, actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOrganizations.addException(exception); + + try { + String resource = "resource-341064690"; + List permissions = new ArrayList<>(); + client.testIamPermissions(resource, permissions); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/ProjectsClientTest.java b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/ProjectsClientTest.java new file mode 100644 index 000000000000..59b8eff2abe3 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/ProjectsClientTest.java @@ -0,0 +1,1120 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import static com.google.cloud.resourcemanager.v3.ProjectsClient.ListProjectsPagedResponse; +import static com.google.cloud.resourcemanager.v3.ProjectsClient.SearchProjectsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.resourcenames.ResourceName; +import com.google.common.collect.Lists; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class ProjectsClientTest { + private static MockServiceHelper mockServiceHelper; + private static MockProjects mockProjects; + private ProjectsClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockProjects = new MockProjects(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockProjects)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ProjectsSettings settings = + ProjectsSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ProjectsClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void getProjectTest() throws Exception { + Project expectedResponse = + Project.newBuilder() + .setName(ProjectName.of("[PROJECT]").toString()) + .setParent("parent-995424086") + .setProjectId("projectId-894832108") + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .build(); + mockProjects.addResponse(expectedResponse); + + ProjectName name = ProjectName.of("[PROJECT]"); + + Project actualResponse = client.getProject(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProjects.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetProjectRequest actualRequest = ((GetProjectRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getProjectExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProjects.addException(exception); + + try { + ProjectName name = ProjectName.of("[PROJECT]"); + client.getProject(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getProjectTest2() throws Exception { + Project expectedResponse = + Project.newBuilder() + .setName(ProjectName.of("[PROJECT]").toString()) + .setParent("parent-995424086") + .setProjectId("projectId-894832108") + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .build(); + mockProjects.addResponse(expectedResponse); + + String name = "name3373707"; + + Project actualResponse = client.getProject(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProjects.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetProjectRequest actualRequest = ((GetProjectRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getProjectExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProjects.addException(exception); + + try { + String name = "name3373707"; + client.getProject(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProjectsTest() throws Exception { + Project responsesElement = Project.newBuilder().build(); + ListProjectsResponse expectedResponse = + ListProjectsResponse.newBuilder() + .setNextPageToken("") + .addAllProjects(Arrays.asList(responsesElement)) + .build(); + mockProjects.addResponse(expectedResponse); + + ResourceName parent = TagValueName.of("[TAG_VALUE]"); + + ListProjectsPagedResponse pagedListResponse = client.listProjects(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProjectsList().get(0), resources.get(0)); + + List actualRequests = mockProjects.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListProjectsRequest actualRequest = ((ListProjectsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listProjectsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProjects.addException(exception); + + try { + ResourceName parent = TagValueName.of("[TAG_VALUE]"); + client.listProjects(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProjectsTest2() throws Exception { + Project responsesElement = Project.newBuilder().build(); + ListProjectsResponse expectedResponse = + ListProjectsResponse.newBuilder() + .setNextPageToken("") + .addAllProjects(Arrays.asList(responsesElement)) + .build(); + mockProjects.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListProjectsPagedResponse pagedListResponse = client.listProjects(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProjectsList().get(0), resources.get(0)); + + List actualRequests = mockProjects.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListProjectsRequest actualRequest = ((ListProjectsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listProjectsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProjects.addException(exception); + + try { + String parent = "parent-995424086"; + client.listProjects(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchProjectsTest() throws Exception { + Project responsesElement = Project.newBuilder().build(); + SearchProjectsResponse expectedResponse = + SearchProjectsResponse.newBuilder() + .setNextPageToken("") + .addAllProjects(Arrays.asList(responsesElement)) + .build(); + mockProjects.addResponse(expectedResponse); + + String query = "query107944136"; + + SearchProjectsPagedResponse pagedListResponse = client.searchProjects(query); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProjectsList().get(0), resources.get(0)); + + List actualRequests = mockProjects.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchProjectsRequest actualRequest = ((SearchProjectsRequest) actualRequests.get(0)); + + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchProjectsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProjects.addException(exception); + + try { + String query = "query107944136"; + client.searchProjects(query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createProjectTest() throws Exception { + Project expectedResponse = + Project.newBuilder() + .setName(ProjectName.of("[PROJECT]").toString()) + .setParent("parent-995424086") + .setProjectId("projectId-894832108") + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createProjectTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProjects.addResponse(resultOperation); + + Project project = Project.newBuilder().build(); + + Project actualResponse = client.createProjectAsync(project).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProjects.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateProjectRequest actualRequest = ((CreateProjectRequest) actualRequests.get(0)); + + Assert.assertEquals(project, actualRequest.getProject()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createProjectExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProjects.addException(exception); + + try { + Project project = Project.newBuilder().build(); + client.createProjectAsync(project).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateProjectTest() throws Exception { + Project expectedResponse = + Project.newBuilder() + .setName(ProjectName.of("[PROJECT]").toString()) + .setParent("parent-995424086") + .setProjectId("projectId-894832108") + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateProjectTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProjects.addResponse(resultOperation); + + Project project = Project.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Project actualResponse = client.updateProjectAsync(project, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProjects.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateProjectRequest actualRequest = ((UpdateProjectRequest) actualRequests.get(0)); + + Assert.assertEquals(project, actualRequest.getProject()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateProjectExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProjects.addException(exception); + + try { + Project project = Project.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateProjectAsync(project, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void moveProjectTest() throws Exception { + Project expectedResponse = + Project.newBuilder() + .setName(ProjectName.of("[PROJECT]").toString()) + .setParent("parent-995424086") + .setProjectId("projectId-894832108") + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("moveProjectTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProjects.addResponse(resultOperation); + + ProjectName name = ProjectName.of("[PROJECT]"); + ResourceName destinationParent = TagValueName.of("[TAG_VALUE]"); + + Project actualResponse = client.moveProjectAsync(name, destinationParent).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProjects.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MoveProjectRequest actualRequest = ((MoveProjectRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(destinationParent.toString(), actualRequest.getDestinationParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void moveProjectExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProjects.addException(exception); + + try { + ProjectName name = ProjectName.of("[PROJECT]"); + ResourceName destinationParent = TagValueName.of("[TAG_VALUE]"); + client.moveProjectAsync(name, destinationParent).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void moveProjectTest2() throws Exception { + Project expectedResponse = + Project.newBuilder() + .setName(ProjectName.of("[PROJECT]").toString()) + .setParent("parent-995424086") + .setProjectId("projectId-894832108") + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("moveProjectTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProjects.addResponse(resultOperation); + + ProjectName name = ProjectName.of("[PROJECT]"); + String destinationParent = "destinationParent-1733659048"; + + Project actualResponse = client.moveProjectAsync(name, destinationParent).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProjects.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MoveProjectRequest actualRequest = ((MoveProjectRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(destinationParent, actualRequest.getDestinationParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void moveProjectExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProjects.addException(exception); + + try { + ProjectName name = ProjectName.of("[PROJECT]"); + String destinationParent = "destinationParent-1733659048"; + client.moveProjectAsync(name, destinationParent).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void moveProjectTest3() throws Exception { + Project expectedResponse = + Project.newBuilder() + .setName(ProjectName.of("[PROJECT]").toString()) + .setParent("parent-995424086") + .setProjectId("projectId-894832108") + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("moveProjectTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProjects.addResponse(resultOperation); + + String name = "name3373707"; + ResourceName destinationParent = TagValueName.of("[TAG_VALUE]"); + + Project actualResponse = client.moveProjectAsync(name, destinationParent).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProjects.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MoveProjectRequest actualRequest = ((MoveProjectRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(destinationParent.toString(), actualRequest.getDestinationParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void moveProjectExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProjects.addException(exception); + + try { + String name = "name3373707"; + ResourceName destinationParent = TagValueName.of("[TAG_VALUE]"); + client.moveProjectAsync(name, destinationParent).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void moveProjectTest4() throws Exception { + Project expectedResponse = + Project.newBuilder() + .setName(ProjectName.of("[PROJECT]").toString()) + .setParent("parent-995424086") + .setProjectId("projectId-894832108") + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("moveProjectTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProjects.addResponse(resultOperation); + + String name = "name3373707"; + String destinationParent = "destinationParent-1733659048"; + + Project actualResponse = client.moveProjectAsync(name, destinationParent).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProjects.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + MoveProjectRequest actualRequest = ((MoveProjectRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(destinationParent, actualRequest.getDestinationParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void moveProjectExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProjects.addException(exception); + + try { + String name = "name3373707"; + String destinationParent = "destinationParent-1733659048"; + client.moveProjectAsync(name, destinationParent).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteProjectTest() throws Exception { + Project expectedResponse = + Project.newBuilder() + .setName(ProjectName.of("[PROJECT]").toString()) + .setParent("parent-995424086") + .setProjectId("projectId-894832108") + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteProjectTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProjects.addResponse(resultOperation); + + ProjectName name = ProjectName.of("[PROJECT]"); + + Project actualResponse = client.deleteProjectAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProjects.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteProjectRequest actualRequest = ((DeleteProjectRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteProjectExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProjects.addException(exception); + + try { + ProjectName name = ProjectName.of("[PROJECT]"); + client.deleteProjectAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteProjectTest2() throws Exception { + Project expectedResponse = + Project.newBuilder() + .setName(ProjectName.of("[PROJECT]").toString()) + .setParent("parent-995424086") + .setProjectId("projectId-894832108") + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteProjectTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProjects.addResponse(resultOperation); + + String name = "name3373707"; + + Project actualResponse = client.deleteProjectAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProjects.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteProjectRequest actualRequest = ((DeleteProjectRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteProjectExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProjects.addException(exception); + + try { + String name = "name3373707"; + client.deleteProjectAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void undeleteProjectTest() throws Exception { + Project expectedResponse = + Project.newBuilder() + .setName(ProjectName.of("[PROJECT]").toString()) + .setParent("parent-995424086") + .setProjectId("projectId-894832108") + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("undeleteProjectTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProjects.addResponse(resultOperation); + + ProjectName name = ProjectName.of("[PROJECT]"); + + Project actualResponse = client.undeleteProjectAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProjects.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UndeleteProjectRequest actualRequest = ((UndeleteProjectRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void undeleteProjectExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProjects.addException(exception); + + try { + ProjectName name = ProjectName.of("[PROJECT]"); + client.undeleteProjectAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void undeleteProjectTest2() throws Exception { + Project expectedResponse = + Project.newBuilder() + .setName(ProjectName.of("[PROJECT]").toString()) + .setParent("parent-995424086") + .setProjectId("projectId-894832108") + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDeleteTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .putAllLabels(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("undeleteProjectTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockProjects.addResponse(resultOperation); + + String name = "name3373707"; + + Project actualResponse = client.undeleteProjectAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProjects.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UndeleteProjectRequest actualRequest = ((UndeleteProjectRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void undeleteProjectExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProjects.addException(exception); + + try { + String name = "name3373707"; + client.undeleteProjectAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockProjects.addResponse(expectedResponse); + + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + + Policy actualResponse = client.getIamPolicy(resource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProjects.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource.toString(), actualRequest.getResource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProjects.addException(exception); + + try { + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + client.getIamPolicy(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest2() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockProjects.addResponse(expectedResponse); + + String resource = "resource-341064690"; + + Policy actualResponse = client.getIamPolicy(resource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProjects.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProjects.addException(exception); + + try { + String resource = "resource-341064690"; + client.getIamPolicy(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockProjects.addResponse(expectedResponse); + + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + Policy policy = Policy.newBuilder().build(); + + Policy actualResponse = client.setIamPolicy(resource, policy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProjects.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource.toString(), actualRequest.getResource()); + Assert.assertEquals(policy, actualRequest.getPolicy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProjects.addException(exception); + + try { + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + Policy policy = Policy.newBuilder().build(); + client.setIamPolicy(resource, policy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest2() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockProjects.addResponse(expectedResponse); + + String resource = "resource-341064690"; + Policy policy = Policy.newBuilder().build(); + + Policy actualResponse = client.setIamPolicy(resource, policy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProjects.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertEquals(policy, actualRequest.getPolicy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProjects.addException(exception); + + try { + String resource = "resource-341064690"; + Policy policy = Policy.newBuilder().build(); + client.setIamPolicy(resource, policy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockProjects.addResponse(expectedResponse); + + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + List permissions = new ArrayList<>(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProjects.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(resource.toString(), actualRequest.getResource()); + Assert.assertEquals(permissions, actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProjects.addException(exception); + + try { + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + List permissions = new ArrayList<>(); + client.testIamPermissions(resource, permissions); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest2() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockProjects.addResponse(expectedResponse); + + String resource = "resource-341064690"; + List permissions = new ArrayList<>(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockProjects.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertEquals(permissions, actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockProjects.addException(exception); + + try { + String resource = "resource-341064690"; + List permissions = new ArrayList<>(); + client.testIamPermissions(resource, permissions); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/TagBindingsClientTest.java b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/TagBindingsClientTest.java new file mode 100644 index 000000000000..1a8b94d35158 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/TagBindingsClientTest.java @@ -0,0 +1,306 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import static com.google.cloud.resourcemanager.v3.TagBindingsClient.ListTagBindingsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.resourcenames.ResourceName; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class TagBindingsClientTest { + private static MockTagBindings mockTagBindings; + private static MockServiceHelper mockServiceHelper; + private TagBindingsClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockTagBindings = new MockTagBindings(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockTagBindings)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + TagBindingsSettings settings = + TagBindingsSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = TagBindingsClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listTagBindingsTest() throws Exception { + TagBinding responsesElement = TagBinding.newBuilder().build(); + ListTagBindingsResponse expectedResponse = + ListTagBindingsResponse.newBuilder() + .setNextPageToken("") + .addAllTagBindings(Arrays.asList(responsesElement)) + .build(); + mockTagBindings.addResponse(expectedResponse); + + ResourceName parent = TagValueName.of("[TAG_VALUE]"); + + ListTagBindingsPagedResponse pagedListResponse = client.listTagBindings(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTagBindingsList().get(0), resources.get(0)); + + List actualRequests = mockTagBindings.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListTagBindingsRequest actualRequest = ((ListTagBindingsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listTagBindingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagBindings.addException(exception); + + try { + ResourceName parent = TagValueName.of("[TAG_VALUE]"); + client.listTagBindings(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTagBindingsTest2() throws Exception { + TagBinding responsesElement = TagBinding.newBuilder().build(); + ListTagBindingsResponse expectedResponse = + ListTagBindingsResponse.newBuilder() + .setNextPageToken("") + .addAllTagBindings(Arrays.asList(responsesElement)) + .build(); + mockTagBindings.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListTagBindingsPagedResponse pagedListResponse = client.listTagBindings(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTagBindingsList().get(0), resources.get(0)); + + List actualRequests = mockTagBindings.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListTagBindingsRequest actualRequest = ((ListTagBindingsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listTagBindingsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagBindings.addException(exception); + + try { + String parent = "parent-995424086"; + client.listTagBindings(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createTagBindingTest() throws Exception { + TagBinding expectedResponse = + TagBinding.newBuilder() + .setName(TagBindingName.of("[TAG_BINDING]").toString()) + .setParent("parent-995424086") + .setTagValue("tagValue-772697609") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createTagBindingTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTagBindings.addResponse(resultOperation); + + TagBinding tagBinding = TagBinding.newBuilder().build(); + + TagBinding actualResponse = client.createTagBindingAsync(tagBinding).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTagBindings.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateTagBindingRequest actualRequest = ((CreateTagBindingRequest) actualRequests.get(0)); + + Assert.assertEquals(tagBinding, actualRequest.getTagBinding()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createTagBindingExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagBindings.addException(exception); + + try { + TagBinding tagBinding = TagBinding.newBuilder().build(); + client.createTagBindingAsync(tagBinding).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteTagBindingTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteTagBindingTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTagBindings.addResponse(resultOperation); + + TagBindingName name = TagBindingName.of("[TAG_BINDING]"); + + client.deleteTagBindingAsync(name).get(); + + List actualRequests = mockTagBindings.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteTagBindingRequest actualRequest = ((DeleteTagBindingRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteTagBindingExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagBindings.addException(exception); + + try { + TagBindingName name = TagBindingName.of("[TAG_BINDING]"); + client.deleteTagBindingAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteTagBindingTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteTagBindingTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTagBindings.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteTagBindingAsync(name).get(); + + List actualRequests = mockTagBindings.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteTagBindingRequest actualRequest = ((DeleteTagBindingRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteTagBindingExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagBindings.addException(exception); + + try { + String name = "name3373707"; + client.deleteTagBindingAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/TagKeysClientTest.java b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/TagKeysClientTest.java new file mode 100644 index 000000000000..78b7d6d68070 --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/TagKeysClientTest.java @@ -0,0 +1,732 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import static com.google.cloud.resourcemanager.v3.TagKeysClient.ListTagKeysPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.resourcenames.ResourceName; +import com.google.common.collect.Lists; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class TagKeysClientTest { + private static MockServiceHelper mockServiceHelper; + private static MockTagKeys mockTagKeys; + private TagKeysClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockTagKeys = new MockTagKeys(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockTagKeys)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + TagKeysSettings settings = + TagKeysSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = TagKeysClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listTagKeysTest() throws Exception { + TagKey responsesElement = TagKey.newBuilder().build(); + ListTagKeysResponse expectedResponse = + ListTagKeysResponse.newBuilder() + .setNextPageToken("") + .addAllTagKeys(Arrays.asList(responsesElement)) + .build(); + mockTagKeys.addResponse(expectedResponse); + + ResourceName parent = TagValueName.of("[TAG_VALUE]"); + + ListTagKeysPagedResponse pagedListResponse = client.listTagKeys(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTagKeysList().get(0), resources.get(0)); + + List actualRequests = mockTagKeys.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListTagKeysRequest actualRequest = ((ListTagKeysRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listTagKeysExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagKeys.addException(exception); + + try { + ResourceName parent = TagValueName.of("[TAG_VALUE]"); + client.listTagKeys(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTagKeysTest2() throws Exception { + TagKey responsesElement = TagKey.newBuilder().build(); + ListTagKeysResponse expectedResponse = + ListTagKeysResponse.newBuilder() + .setNextPageToken("") + .addAllTagKeys(Arrays.asList(responsesElement)) + .build(); + mockTagKeys.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListTagKeysPagedResponse pagedListResponse = client.listTagKeys(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTagKeysList().get(0), resources.get(0)); + + List actualRequests = mockTagKeys.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListTagKeysRequest actualRequest = ((ListTagKeysRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listTagKeysExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagKeys.addException(exception); + + try { + String parent = "parent-995424086"; + client.listTagKeys(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTagKeyTest() throws Exception { + TagKey expectedResponse = + TagKey.newBuilder() + .setName(TagKeyName.of("[TAG_KEY]").toString()) + .setParent("parent-995424086") + .setShortName("shortName-2028219097") + .setNamespacedName("namespacedName-1877415788") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + mockTagKeys.addResponse(expectedResponse); + + TagKeyName name = TagKeyName.of("[TAG_KEY]"); + + TagKey actualResponse = client.getTagKey(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTagKeys.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetTagKeyRequest actualRequest = ((GetTagKeyRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getTagKeyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagKeys.addException(exception); + + try { + TagKeyName name = TagKeyName.of("[TAG_KEY]"); + client.getTagKey(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTagKeyTest2() throws Exception { + TagKey expectedResponse = + TagKey.newBuilder() + .setName(TagKeyName.of("[TAG_KEY]").toString()) + .setParent("parent-995424086") + .setShortName("shortName-2028219097") + .setNamespacedName("namespacedName-1877415788") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + mockTagKeys.addResponse(expectedResponse); + + String name = "name3373707"; + + TagKey actualResponse = client.getTagKey(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTagKeys.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetTagKeyRequest actualRequest = ((GetTagKeyRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getTagKeyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagKeys.addException(exception); + + try { + String name = "name3373707"; + client.getTagKey(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createTagKeyTest() throws Exception { + TagKey expectedResponse = + TagKey.newBuilder() + .setName(TagKeyName.of("[TAG_KEY]").toString()) + .setParent("parent-995424086") + .setShortName("shortName-2028219097") + .setNamespacedName("namespacedName-1877415788") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createTagKeyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTagKeys.addResponse(resultOperation); + + TagKey tagKey = TagKey.newBuilder().build(); + + TagKey actualResponse = client.createTagKeyAsync(tagKey).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTagKeys.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateTagKeyRequest actualRequest = ((CreateTagKeyRequest) actualRequests.get(0)); + + Assert.assertEquals(tagKey, actualRequest.getTagKey()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createTagKeyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagKeys.addException(exception); + + try { + TagKey tagKey = TagKey.newBuilder().build(); + client.createTagKeyAsync(tagKey).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateTagKeyTest() throws Exception { + TagKey expectedResponse = + TagKey.newBuilder() + .setName(TagKeyName.of("[TAG_KEY]").toString()) + .setParent("parent-995424086") + .setShortName("shortName-2028219097") + .setNamespacedName("namespacedName-1877415788") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateTagKeyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTagKeys.addResponse(resultOperation); + + TagKey tagKey = TagKey.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + TagKey actualResponse = client.updateTagKeyAsync(tagKey, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTagKeys.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateTagKeyRequest actualRequest = ((UpdateTagKeyRequest) actualRequests.get(0)); + + Assert.assertEquals(tagKey, actualRequest.getTagKey()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateTagKeyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagKeys.addException(exception); + + try { + TagKey tagKey = TagKey.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateTagKeyAsync(tagKey, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteTagKeyTest() throws Exception { + TagKey expectedResponse = + TagKey.newBuilder() + .setName(TagKeyName.of("[TAG_KEY]").toString()) + .setParent("parent-995424086") + .setShortName("shortName-2028219097") + .setNamespacedName("namespacedName-1877415788") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteTagKeyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTagKeys.addResponse(resultOperation); + + TagKeyName name = TagKeyName.of("[TAG_KEY]"); + + TagKey actualResponse = client.deleteTagKeyAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTagKeys.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteTagKeyRequest actualRequest = ((DeleteTagKeyRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteTagKeyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagKeys.addException(exception); + + try { + TagKeyName name = TagKeyName.of("[TAG_KEY]"); + client.deleteTagKeyAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteTagKeyTest2() throws Exception { + TagKey expectedResponse = + TagKey.newBuilder() + .setName(TagKeyName.of("[TAG_KEY]").toString()) + .setParent("parent-995424086") + .setShortName("shortName-2028219097") + .setNamespacedName("namespacedName-1877415788") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteTagKeyTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTagKeys.addResponse(resultOperation); + + String name = "name3373707"; + + TagKey actualResponse = client.deleteTagKeyAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTagKeys.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteTagKeyRequest actualRequest = ((DeleteTagKeyRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteTagKeyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagKeys.addException(exception); + + try { + String name = "name3373707"; + client.deleteTagKeyAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockTagKeys.addResponse(expectedResponse); + + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + + Policy actualResponse = client.getIamPolicy(resource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTagKeys.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource.toString(), actualRequest.getResource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagKeys.addException(exception); + + try { + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + client.getIamPolicy(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest2() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockTagKeys.addResponse(expectedResponse); + + String resource = "resource-341064690"; + + Policy actualResponse = client.getIamPolicy(resource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTagKeys.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagKeys.addException(exception); + + try { + String resource = "resource-341064690"; + client.getIamPolicy(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockTagKeys.addResponse(expectedResponse); + + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + Policy policy = Policy.newBuilder().build(); + + Policy actualResponse = client.setIamPolicy(resource, policy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTagKeys.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource.toString(), actualRequest.getResource()); + Assert.assertEquals(policy, actualRequest.getPolicy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagKeys.addException(exception); + + try { + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + Policy policy = Policy.newBuilder().build(); + client.setIamPolicy(resource, policy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest2() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockTagKeys.addResponse(expectedResponse); + + String resource = "resource-341064690"; + Policy policy = Policy.newBuilder().build(); + + Policy actualResponse = client.setIamPolicy(resource, policy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTagKeys.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertEquals(policy, actualRequest.getPolicy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagKeys.addException(exception); + + try { + String resource = "resource-341064690"; + Policy policy = Policy.newBuilder().build(); + client.setIamPolicy(resource, policy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockTagKeys.addResponse(expectedResponse); + + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + List permissions = new ArrayList<>(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTagKeys.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(resource.toString(), actualRequest.getResource()); + Assert.assertEquals(permissions, actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagKeys.addException(exception); + + try { + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + List permissions = new ArrayList<>(); + client.testIamPermissions(resource, permissions); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest2() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockTagKeys.addResponse(expectedResponse); + + String resource = "resource-341064690"; + List permissions = new ArrayList<>(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTagKeys.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertEquals(permissions, actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagKeys.addException(exception); + + try { + String resource = "resource-341064690"; + List permissions = new ArrayList<>(); + client.testIamPermissions(resource, permissions); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/TagValuesClientTest.java b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/TagValuesClientTest.java new file mode 100644 index 000000000000..3a861d9aaeac --- /dev/null +++ b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/TagValuesClientTest.java @@ -0,0 +1,732 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import static com.google.cloud.resourcemanager.v3.TagValuesClient.ListTagValuesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.resourcenames.ResourceName; +import com.google.common.collect.Lists; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class TagValuesClientTest { + private static MockTagValues mockTagValues; + private static MockServiceHelper mockServiceHelper; + private TagValuesClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockTagValues = new MockTagValues(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockTagValues)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + TagValuesSettings settings = + TagValuesSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = TagValuesClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listTagValuesTest() throws Exception { + TagValue responsesElement = TagValue.newBuilder().build(); + ListTagValuesResponse expectedResponse = + ListTagValuesResponse.newBuilder() + .setNextPageToken("") + .addAllTagValues(Arrays.asList(responsesElement)) + .build(); + mockTagValues.addResponse(expectedResponse); + + ResourceName parent = TagValueName.of("[TAG_VALUE]"); + + ListTagValuesPagedResponse pagedListResponse = client.listTagValues(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTagValuesList().get(0), resources.get(0)); + + List actualRequests = mockTagValues.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListTagValuesRequest actualRequest = ((ListTagValuesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listTagValuesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagValues.addException(exception); + + try { + ResourceName parent = TagValueName.of("[TAG_VALUE]"); + client.listTagValues(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTagValuesTest2() throws Exception { + TagValue responsesElement = TagValue.newBuilder().build(); + ListTagValuesResponse expectedResponse = + ListTagValuesResponse.newBuilder() + .setNextPageToken("") + .addAllTagValues(Arrays.asList(responsesElement)) + .build(); + mockTagValues.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListTagValuesPagedResponse pagedListResponse = client.listTagValues(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTagValuesList().get(0), resources.get(0)); + + List actualRequests = mockTagValues.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListTagValuesRequest actualRequest = ((ListTagValuesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listTagValuesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagValues.addException(exception); + + try { + String parent = "parent-995424086"; + client.listTagValues(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTagValueTest() throws Exception { + TagValue expectedResponse = + TagValue.newBuilder() + .setName(TagValueName.of("[TAG_VALUE]").toString()) + .setParent("parent-995424086") + .setShortName("shortName-2028219097") + .setNamespacedName("namespacedName-1877415788") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + mockTagValues.addResponse(expectedResponse); + + TagValueName name = TagValueName.of("[TAG_VALUE]"); + + TagValue actualResponse = client.getTagValue(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTagValues.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetTagValueRequest actualRequest = ((GetTagValueRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getTagValueExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagValues.addException(exception); + + try { + TagValueName name = TagValueName.of("[TAG_VALUE]"); + client.getTagValue(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTagValueTest2() throws Exception { + TagValue expectedResponse = + TagValue.newBuilder() + .setName(TagValueName.of("[TAG_VALUE]").toString()) + .setParent("parent-995424086") + .setShortName("shortName-2028219097") + .setNamespacedName("namespacedName-1877415788") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + mockTagValues.addResponse(expectedResponse); + + String name = "name3373707"; + + TagValue actualResponse = client.getTagValue(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTagValues.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetTagValueRequest actualRequest = ((GetTagValueRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getTagValueExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagValues.addException(exception); + + try { + String name = "name3373707"; + client.getTagValue(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createTagValueTest() throws Exception { + TagValue expectedResponse = + TagValue.newBuilder() + .setName(TagValueName.of("[TAG_VALUE]").toString()) + .setParent("parent-995424086") + .setShortName("shortName-2028219097") + .setNamespacedName("namespacedName-1877415788") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createTagValueTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTagValues.addResponse(resultOperation); + + TagValue tagValue = TagValue.newBuilder().build(); + + TagValue actualResponse = client.createTagValueAsync(tagValue).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTagValues.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateTagValueRequest actualRequest = ((CreateTagValueRequest) actualRequests.get(0)); + + Assert.assertEquals(tagValue, actualRequest.getTagValue()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createTagValueExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagValues.addException(exception); + + try { + TagValue tagValue = TagValue.newBuilder().build(); + client.createTagValueAsync(tagValue).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateTagValueTest() throws Exception { + TagValue expectedResponse = + TagValue.newBuilder() + .setName(TagValueName.of("[TAG_VALUE]").toString()) + .setParent("parent-995424086") + .setShortName("shortName-2028219097") + .setNamespacedName("namespacedName-1877415788") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateTagValueTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTagValues.addResponse(resultOperation); + + TagValue tagValue = TagValue.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + TagValue actualResponse = client.updateTagValueAsync(tagValue, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTagValues.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateTagValueRequest actualRequest = ((UpdateTagValueRequest) actualRequests.get(0)); + + Assert.assertEquals(tagValue, actualRequest.getTagValue()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateTagValueExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagValues.addException(exception); + + try { + TagValue tagValue = TagValue.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateTagValueAsync(tagValue, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteTagValueTest() throws Exception { + TagValue expectedResponse = + TagValue.newBuilder() + .setName(TagValueName.of("[TAG_VALUE]").toString()) + .setParent("parent-995424086") + .setShortName("shortName-2028219097") + .setNamespacedName("namespacedName-1877415788") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteTagValueTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTagValues.addResponse(resultOperation); + + TagValueName name = TagValueName.of("[TAG_VALUE]"); + + TagValue actualResponse = client.deleteTagValueAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTagValues.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteTagValueRequest actualRequest = ((DeleteTagValueRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteTagValueExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagValues.addException(exception); + + try { + TagValueName name = TagValueName.of("[TAG_VALUE]"); + client.deleteTagValueAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteTagValueTest2() throws Exception { + TagValue expectedResponse = + TagValue.newBuilder() + .setName(TagValueName.of("[TAG_VALUE]").toString()) + .setParent("parent-995424086") + .setShortName("shortName-2028219097") + .setNamespacedName("namespacedName-1877415788") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteTagValueTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockTagValues.addResponse(resultOperation); + + String name = "name3373707"; + + TagValue actualResponse = client.deleteTagValueAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTagValues.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteTagValueRequest actualRequest = ((DeleteTagValueRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteTagValueExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagValues.addException(exception); + + try { + String name = "name3373707"; + client.deleteTagValueAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockTagValues.addResponse(expectedResponse); + + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + + Policy actualResponse = client.getIamPolicy(resource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTagValues.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource.toString(), actualRequest.getResource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagValues.addException(exception); + + try { + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + client.getIamPolicy(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest2() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockTagValues.addResponse(expectedResponse); + + String resource = "resource-341064690"; + + Policy actualResponse = client.getIamPolicy(resource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTagValues.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagValues.addException(exception); + + try { + String resource = "resource-341064690"; + client.getIamPolicy(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockTagValues.addResponse(expectedResponse); + + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + Policy policy = Policy.newBuilder().build(); + + Policy actualResponse = client.setIamPolicy(resource, policy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTagValues.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource.toString(), actualRequest.getResource()); + Assert.assertEquals(policy, actualRequest.getPolicy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagValues.addException(exception); + + try { + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + Policy policy = Policy.newBuilder().build(); + client.setIamPolicy(resource, policy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest2() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockTagValues.addResponse(expectedResponse); + + String resource = "resource-341064690"; + Policy policy = Policy.newBuilder().build(); + + Policy actualResponse = client.setIamPolicy(resource, policy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTagValues.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertEquals(policy, actualRequest.getPolicy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagValues.addException(exception); + + try { + String resource = "resource-341064690"; + Policy policy = Policy.newBuilder().build(); + client.setIamPolicy(resource, policy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockTagValues.addResponse(expectedResponse); + + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + List permissions = new ArrayList<>(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTagValues.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(resource.toString(), actualRequest.getResource()); + Assert.assertEquals(permissions, actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagValues.addException(exception); + + try { + ResourceName resource = TagValueName.of("[TAG_VALUE]"); + List permissions = new ArrayList<>(); + client.testIamPermissions(resource, permissions); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest2() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockTagValues.addResponse(expectedResponse); + + String resource = "resource-341064690"; + List permissions = new ArrayList<>(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTagValues.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertEquals(permissions, actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTagValues.addException(exception); + + try { + String resource = "resource-341064690"; + List permissions = new ArrayList<>(); + client.testIamPermissions(resource, permissions); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-resourcemanager/grpc-google-cloud-resourcemanager-v3/pom.xml b/java-resourcemanager/grpc-google-cloud-resourcemanager-v3/pom.xml new file mode 100644 index 000000000000..721a91a00576 --- /dev/null +++ b/java-resourcemanager/grpc-google-cloud-resourcemanager-v3/pom.xml @@ -0,0 +1,73 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-resourcemanager-v3 + 0.118.13-alpha-SNAPSHOT + grpc-google-cloud-resourcemanager-v3 + GRPC library for google-cloud-resourcemanager + + com.google.cloud + google-cloud-resourcemanager-parent + 0.118.13-alpha-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + proto-google-cloud-resourcemanager-v3 + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/java-resourcemanager/grpc-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/FoldersGrpc.java b/java-resourcemanager/grpc-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/FoldersGrpc.java new file mode 100644 index 000000000000..c10f30b77943 --- /dev/null +++ b/java-resourcemanager/grpc-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/FoldersGrpc.java @@ -0,0 +1,1850 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.resourcemanager.v3; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Manages Cloud Platform folder resources.
+ * Folders can be used to organize the resources under an
+ * organization and to control the policies applied to groups of resources.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/resourcemanager/v3/folders.proto") +public final class FoldersGrpc { + + private FoldersGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.resourcemanager.v3.Folders"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.GetFolderRequest, + com.google.cloud.resourcemanager.v3.Folder> + getGetFolderMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetFolder", + requestType = com.google.cloud.resourcemanager.v3.GetFolderRequest.class, + responseType = com.google.cloud.resourcemanager.v3.Folder.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.GetFolderRequest, + com.google.cloud.resourcemanager.v3.Folder> + getGetFolderMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.GetFolderRequest, + com.google.cloud.resourcemanager.v3.Folder> + getGetFolderMethod; + if ((getGetFolderMethod = FoldersGrpc.getGetFolderMethod) == null) { + synchronized (FoldersGrpc.class) { + if ((getGetFolderMethod = FoldersGrpc.getGetFolderMethod) == null) { + FoldersGrpc.getGetFolderMethod = + getGetFolderMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetFolder")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.GetFolderRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.Folder.getDefaultInstance())) + .setSchemaDescriptor(new FoldersMethodDescriptorSupplier("GetFolder")) + .build(); + } + } + } + return getGetFolderMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.ListFoldersRequest, + com.google.cloud.resourcemanager.v3.ListFoldersResponse> + getListFoldersMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListFolders", + requestType = com.google.cloud.resourcemanager.v3.ListFoldersRequest.class, + responseType = com.google.cloud.resourcemanager.v3.ListFoldersResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.ListFoldersRequest, + com.google.cloud.resourcemanager.v3.ListFoldersResponse> + getListFoldersMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.ListFoldersRequest, + com.google.cloud.resourcemanager.v3.ListFoldersResponse> + getListFoldersMethod; + if ((getListFoldersMethod = FoldersGrpc.getListFoldersMethod) == null) { + synchronized (FoldersGrpc.class) { + if ((getListFoldersMethod = FoldersGrpc.getListFoldersMethod) == null) { + FoldersGrpc.getListFoldersMethod = + getListFoldersMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListFolders")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.ListFoldersRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.ListFoldersResponse + .getDefaultInstance())) + .setSchemaDescriptor(new FoldersMethodDescriptorSupplier("ListFolders")) + .build(); + } + } + } + return getListFoldersMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.SearchFoldersRequest, + com.google.cloud.resourcemanager.v3.SearchFoldersResponse> + getSearchFoldersMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SearchFolders", + requestType = com.google.cloud.resourcemanager.v3.SearchFoldersRequest.class, + responseType = com.google.cloud.resourcemanager.v3.SearchFoldersResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.SearchFoldersRequest, + com.google.cloud.resourcemanager.v3.SearchFoldersResponse> + getSearchFoldersMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.SearchFoldersRequest, + com.google.cloud.resourcemanager.v3.SearchFoldersResponse> + getSearchFoldersMethod; + if ((getSearchFoldersMethod = FoldersGrpc.getSearchFoldersMethod) == null) { + synchronized (FoldersGrpc.class) { + if ((getSearchFoldersMethod = FoldersGrpc.getSearchFoldersMethod) == null) { + FoldersGrpc.getSearchFoldersMethod = + getSearchFoldersMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SearchFolders")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.SearchFoldersRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.SearchFoldersResponse + .getDefaultInstance())) + .setSchemaDescriptor(new FoldersMethodDescriptorSupplier("SearchFolders")) + .build(); + } + } + } + return getSearchFoldersMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.CreateFolderRequest, com.google.longrunning.Operation> + getCreateFolderMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateFolder", + requestType = com.google.cloud.resourcemanager.v3.CreateFolderRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.CreateFolderRequest, com.google.longrunning.Operation> + getCreateFolderMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.CreateFolderRequest, + com.google.longrunning.Operation> + getCreateFolderMethod; + if ((getCreateFolderMethod = FoldersGrpc.getCreateFolderMethod) == null) { + synchronized (FoldersGrpc.class) { + if ((getCreateFolderMethod = FoldersGrpc.getCreateFolderMethod) == null) { + FoldersGrpc.getCreateFolderMethod = + getCreateFolderMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateFolder")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.CreateFolderRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new FoldersMethodDescriptorSupplier("CreateFolder")) + .build(); + } + } + } + return getCreateFolderMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.UpdateFolderRequest, com.google.longrunning.Operation> + getUpdateFolderMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateFolder", + requestType = com.google.cloud.resourcemanager.v3.UpdateFolderRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.UpdateFolderRequest, com.google.longrunning.Operation> + getUpdateFolderMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.UpdateFolderRequest, + com.google.longrunning.Operation> + getUpdateFolderMethod; + if ((getUpdateFolderMethod = FoldersGrpc.getUpdateFolderMethod) == null) { + synchronized (FoldersGrpc.class) { + if ((getUpdateFolderMethod = FoldersGrpc.getUpdateFolderMethod) == null) { + FoldersGrpc.getUpdateFolderMethod = + getUpdateFolderMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateFolder")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.UpdateFolderRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new FoldersMethodDescriptorSupplier("UpdateFolder")) + .build(); + } + } + } + return getUpdateFolderMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.MoveFolderRequest, com.google.longrunning.Operation> + getMoveFolderMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "MoveFolder", + requestType = com.google.cloud.resourcemanager.v3.MoveFolderRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.MoveFolderRequest, com.google.longrunning.Operation> + getMoveFolderMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.MoveFolderRequest, com.google.longrunning.Operation> + getMoveFolderMethod; + if ((getMoveFolderMethod = FoldersGrpc.getMoveFolderMethod) == null) { + synchronized (FoldersGrpc.class) { + if ((getMoveFolderMethod = FoldersGrpc.getMoveFolderMethod) == null) { + FoldersGrpc.getMoveFolderMethod = + getMoveFolderMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "MoveFolder")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.MoveFolderRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new FoldersMethodDescriptorSupplier("MoveFolder")) + .build(); + } + } + } + return getMoveFolderMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.DeleteFolderRequest, com.google.longrunning.Operation> + getDeleteFolderMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteFolder", + requestType = com.google.cloud.resourcemanager.v3.DeleteFolderRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.DeleteFolderRequest, com.google.longrunning.Operation> + getDeleteFolderMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.DeleteFolderRequest, + com.google.longrunning.Operation> + getDeleteFolderMethod; + if ((getDeleteFolderMethod = FoldersGrpc.getDeleteFolderMethod) == null) { + synchronized (FoldersGrpc.class) { + if ((getDeleteFolderMethod = FoldersGrpc.getDeleteFolderMethod) == null) { + FoldersGrpc.getDeleteFolderMethod = + getDeleteFolderMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteFolder")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.DeleteFolderRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new FoldersMethodDescriptorSupplier("DeleteFolder")) + .build(); + } + } + } + return getDeleteFolderMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.UndeleteFolderRequest, + com.google.longrunning.Operation> + getUndeleteFolderMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UndeleteFolder", + requestType = com.google.cloud.resourcemanager.v3.UndeleteFolderRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.UndeleteFolderRequest, + com.google.longrunning.Operation> + getUndeleteFolderMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.UndeleteFolderRequest, + com.google.longrunning.Operation> + getUndeleteFolderMethod; + if ((getUndeleteFolderMethod = FoldersGrpc.getUndeleteFolderMethod) == null) { + synchronized (FoldersGrpc.class) { + if ((getUndeleteFolderMethod = FoldersGrpc.getUndeleteFolderMethod) == null) { + FoldersGrpc.getUndeleteFolderMethod = + getUndeleteFolderMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UndeleteFolder")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.UndeleteFolderRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new FoldersMethodDescriptorSupplier("UndeleteFolder")) + .build(); + } + } + } + return getUndeleteFolderMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetIamPolicy", + requestType = com.google.iam.v1.GetIamPolicyRequest.class, + responseType = com.google.iam.v1.Policy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod() { + io.grpc.MethodDescriptor + getGetIamPolicyMethod; + if ((getGetIamPolicyMethod = FoldersGrpc.getGetIamPolicyMethod) == null) { + synchronized (FoldersGrpc.class) { + if ((getGetIamPolicyMethod = FoldersGrpc.getGetIamPolicyMethod) == null) { + FoldersGrpc.getGetIamPolicyMethod = + getGetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor(new FoldersMethodDescriptorSupplier("GetIamPolicy")) + .build(); + } + } + } + return getGetIamPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetIamPolicy", + requestType = com.google.iam.v1.SetIamPolicyRequest.class, + responseType = com.google.iam.v1.Policy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod() { + io.grpc.MethodDescriptor + getSetIamPolicyMethod; + if ((getSetIamPolicyMethod = FoldersGrpc.getSetIamPolicyMethod) == null) { + synchronized (FoldersGrpc.class) { + if ((getSetIamPolicyMethod = FoldersGrpc.getSetIamPolicyMethod) == null) { + FoldersGrpc.getSetIamPolicyMethod = + getSetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor(new FoldersMethodDescriptorSupplier("SetIamPolicy")) + .build(); + } + } + } + return getSetIamPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "TestIamPermissions", + requestType = com.google.iam.v1.TestIamPermissionsRequest.class, + responseType = com.google.iam.v1.TestIamPermissionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + if ((getTestIamPermissionsMethod = FoldersGrpc.getTestIamPermissionsMethod) == null) { + synchronized (FoldersGrpc.class) { + if ((getTestIamPermissionsMethod = FoldersGrpc.getTestIamPermissionsMethod) == null) { + FoldersGrpc.getTestIamPermissionsMethod = + getTestIamPermissionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "TestIamPermissions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new FoldersMethodDescriptorSupplier("TestIamPermissions")) + .build(); + } + } + } + return getTestIamPermissionsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static FoldersStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public FoldersStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FoldersStub(channel, callOptions); + } + }; + return FoldersStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static FoldersBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public FoldersBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FoldersBlockingStub(channel, callOptions); + } + }; + return FoldersBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static FoldersFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public FoldersFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FoldersFutureStub(channel, callOptions); + } + }; + return FoldersFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Manages Cloud Platform folder resources.
+   * Folders can be used to organize the resources under an
+   * organization and to control the policies applied to groups of resources.
+   * 
+ */ + public abstract static class FoldersImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void getFolder( + com.google.cloud.resourcemanager.v3.GetFolderRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetFolderMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void listFolders( + com.google.cloud.resourcemanager.v3.ListFoldersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListFoldersMethod(), responseObserver); + } + + /** + * + * + *
+     * 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`.
+     * 
+ */ + public void searchFolders( + com.google.cloud.resourcemanager.v3.SearchFoldersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSearchFoldersMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void createFolder( + com.google.cloud.resourcemanager.v3.CreateFolderRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateFolderMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void updateFolder( + com.google.cloud.resourcemanager.v3.UpdateFolderRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateFolderMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void moveFolder( + com.google.cloud.resourcemanager.v3.MoveFolderRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getMoveFolderMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void deleteFolder( + com.google.cloud.resourcemanager.v3.DeleteFolderRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteFolderMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void undeleteFolder( + com.google.cloud.resourcemanager.v3.UndeleteFolderRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUndeleteFolderMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetIamPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSetIamPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getTestIamPermissionsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetFolderMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.GetFolderRequest, + com.google.cloud.resourcemanager.v3.Folder>(this, METHODID_GET_FOLDER))) + .addMethod( + getListFoldersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.ListFoldersRequest, + com.google.cloud.resourcemanager.v3.ListFoldersResponse>( + this, METHODID_LIST_FOLDERS))) + .addMethod( + getSearchFoldersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.SearchFoldersRequest, + com.google.cloud.resourcemanager.v3.SearchFoldersResponse>( + this, METHODID_SEARCH_FOLDERS))) + .addMethod( + getCreateFolderMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.CreateFolderRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_FOLDER))) + .addMethod( + getUpdateFolderMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.UpdateFolderRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_FOLDER))) + .addMethod( + getMoveFolderMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.MoveFolderRequest, + com.google.longrunning.Operation>(this, METHODID_MOVE_FOLDER))) + .addMethod( + getDeleteFolderMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.DeleteFolderRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_FOLDER))) + .addMethod( + getUndeleteFolderMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.UndeleteFolderRequest, + com.google.longrunning.Operation>(this, METHODID_UNDELETE_FOLDER))) + .addMethod( + getGetIamPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_GET_IAM_POLICY))) + .addMethod( + getSetIamPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_SET_IAM_POLICY))) + .addMethod( + getTestIamPermissionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse>( + this, METHODID_TEST_IAM_PERMISSIONS))) + .build(); + } + } + + /** + * + * + *
+   * Manages Cloud Platform folder resources.
+   * Folders can be used to organize the resources under an
+   * organization and to control the policies applied to groups of resources.
+   * 
+ */ + public static final class FoldersStub extends io.grpc.stub.AbstractAsyncStub { + private FoldersStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected FoldersStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FoldersStub(channel, callOptions); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void getFolder( + com.google.cloud.resourcemanager.v3.GetFolderRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetFolderMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void listFolders( + com.google.cloud.resourcemanager.v3.ListFoldersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListFoldersMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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`.
+     * 
+ */ + public void searchFolders( + com.google.cloud.resourcemanager.v3.SearchFoldersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSearchFoldersMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void createFolder( + com.google.cloud.resourcemanager.v3.CreateFolderRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateFolderMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void updateFolder( + com.google.cloud.resourcemanager.v3.UpdateFolderRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateFolderMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void moveFolder( + com.google.cloud.resourcemanager.v3.MoveFolderRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getMoveFolderMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void deleteFolder( + com.google.cloud.resourcemanager.v3.DeleteFolderRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteFolderMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void undeleteFolder( + com.google.cloud.resourcemanager.v3.UndeleteFolderRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUndeleteFolderMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Manages Cloud Platform folder resources.
+   * Folders can be used to organize the resources under an
+   * organization and to control the policies applied to groups of resources.
+   * 
+ */ + public static final class FoldersBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private FoldersBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected FoldersBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FoldersBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.cloud.resourcemanager.v3.Folder getFolder( + com.google.cloud.resourcemanager.v3.GetFolderRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetFolderMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.cloud.resourcemanager.v3.ListFoldersResponse listFolders( + com.google.cloud.resourcemanager.v3.ListFoldersRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListFoldersMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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`.
+     * 
+ */ + public com.google.cloud.resourcemanager.v3.SearchFoldersResponse searchFolders( + com.google.cloud.resourcemanager.v3.SearchFoldersRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSearchFoldersMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.longrunning.Operation createFolder( + com.google.cloud.resourcemanager.v3.CreateFolderRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateFolderMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.longrunning.Operation updateFolder( + com.google.cloud.resourcemanager.v3.UpdateFolderRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateFolderMethod(), getCallOptions(), 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.
+     * 
+ */ + public com.google.longrunning.Operation moveFolder( + com.google.cloud.resourcemanager.v3.MoveFolderRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getMoveFolderMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.longrunning.Operation deleteFolder( + com.google.cloud.resourcemanager.v3.DeleteFolderRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteFolderMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.longrunning.Operation undeleteFolder( + com.google.cloud.resourcemanager.v3.UndeleteFolderRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUndeleteFolderMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetIamPolicyMethod(), getCallOptions(), 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.
+     * 
+ */ + public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getTestIamPermissionsMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Manages Cloud Platform folder resources.
+   * Folders can be used to organize the resources under an
+   * organization and to control the policies applied to groups of resources.
+   * 
+ */ + public static final class FoldersFutureStub + extends io.grpc.stub.AbstractFutureStub { + private FoldersFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected FoldersFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FoldersFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.resourcemanager.v3.Folder> + getFolder(com.google.cloud.resourcemanager.v3.GetFolderRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetFolderMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.resourcemanager.v3.ListFoldersResponse> + listFolders(com.google.cloud.resourcemanager.v3.ListFoldersRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListFoldersMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.resourcemanager.v3.SearchFoldersResponse> + searchFolders(com.google.cloud.resourcemanager.v3.SearchFoldersRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSearchFoldersMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createFolder(com.google.cloud.resourcemanager.v3.CreateFolderRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateFolderMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateFolder(com.google.cloud.resourcemanager.v3.UpdateFolderRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateFolderMethod(), getCallOptions()), 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + moveFolder(com.google.cloud.resourcemanager.v3.MoveFolderRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getMoveFolderMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteFolder(com.google.cloud.resourcemanager.v3.DeleteFolderRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteFolderMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + undeleteFolder(com.google.cloud.resourcemanager.v3.UndeleteFolderRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUndeleteFolderMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v1.TestIamPermissionsResponse> + testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_FOLDER = 0; + private static final int METHODID_LIST_FOLDERS = 1; + private static final int METHODID_SEARCH_FOLDERS = 2; + private static final int METHODID_CREATE_FOLDER = 3; + private static final int METHODID_UPDATE_FOLDER = 4; + private static final int METHODID_MOVE_FOLDER = 5; + private static final int METHODID_DELETE_FOLDER = 6; + private static final int METHODID_UNDELETE_FOLDER = 7; + private static final int METHODID_GET_IAM_POLICY = 8; + private static final int METHODID_SET_IAM_POLICY = 9; + private static final int METHODID_TEST_IAM_PERMISSIONS = 10; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final FoldersImplBase serviceImpl; + private final int methodId; + + MethodHandlers(FoldersImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_GET_FOLDER: + serviceImpl.getFolder( + (com.google.cloud.resourcemanager.v3.GetFolderRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_FOLDERS: + serviceImpl.listFolders( + (com.google.cloud.resourcemanager.v3.ListFoldersRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_SEARCH_FOLDERS: + serviceImpl.searchFolders( + (com.google.cloud.resourcemanager.v3.SearchFoldersRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.resourcemanager.v3.SearchFoldersResponse>) + responseObserver); + break; + case METHODID_CREATE_FOLDER: + serviceImpl.createFolder( + (com.google.cloud.resourcemanager.v3.CreateFolderRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_FOLDER: + serviceImpl.updateFolder( + (com.google.cloud.resourcemanager.v3.UpdateFolderRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_MOVE_FOLDER: + serviceImpl.moveFolder( + (com.google.cloud.resourcemanager.v3.MoveFolderRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_FOLDER: + serviceImpl.deleteFolder( + (com.google.cloud.resourcemanager.v3.DeleteFolderRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UNDELETE_FOLDER: + serviceImpl.undeleteFolder( + (com.google.cloud.resourcemanager.v3.UndeleteFolderRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_IAM_POLICY: + serviceImpl.getIamPolicy( + (com.google.iam.v1.GetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_IAM_POLICY: + serviceImpl.setIamPolicy( + (com.google.iam.v1.SetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_TEST_IAM_PERMISSIONS: + serviceImpl.testIamPermissions( + (com.google.iam.v1.TestIamPermissionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class FoldersBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + FoldersBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Folders"); + } + } + + private static final class FoldersFileDescriptorSupplier extends FoldersBaseDescriptorSupplier { + FoldersFileDescriptorSupplier() {} + } + + private static final class FoldersMethodDescriptorSupplier extends FoldersBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + FoldersMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (FoldersGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new FoldersFileDescriptorSupplier()) + .addMethod(getGetFolderMethod()) + .addMethod(getListFoldersMethod()) + .addMethod(getSearchFoldersMethod()) + .addMethod(getCreateFolderMethod()) + .addMethod(getUpdateFolderMethod()) + .addMethod(getMoveFolderMethod()) + .addMethod(getDeleteFolderMethod()) + .addMethod(getUndeleteFolderMethod()) + .addMethod(getGetIamPolicyMethod()) + .addMethod(getSetIamPolicyMethod()) + .addMethod(getTestIamPermissionsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-resourcemanager/grpc-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationsGrpc.java b/java-resourcemanager/grpc-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationsGrpc.java new file mode 100644 index 000000000000..099a836d5d64 --- /dev/null +++ b/java-resourcemanager/grpc-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationsGrpc.java @@ -0,0 +1,882 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.resourcemanager.v3; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Allows users to manage their organization resources.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/resourcemanager/v3/organizations.proto") +public final class OrganizationsGrpc { + + private OrganizationsGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.resourcemanager.v3.Organizations"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.GetOrganizationRequest, + com.google.cloud.resourcemanager.v3.Organization> + getGetOrganizationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetOrganization", + requestType = com.google.cloud.resourcemanager.v3.GetOrganizationRequest.class, + responseType = com.google.cloud.resourcemanager.v3.Organization.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.GetOrganizationRequest, + com.google.cloud.resourcemanager.v3.Organization> + getGetOrganizationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.GetOrganizationRequest, + com.google.cloud.resourcemanager.v3.Organization> + getGetOrganizationMethod; + if ((getGetOrganizationMethod = OrganizationsGrpc.getGetOrganizationMethod) == null) { + synchronized (OrganizationsGrpc.class) { + if ((getGetOrganizationMethod = OrganizationsGrpc.getGetOrganizationMethod) == null) { + OrganizationsGrpc.getGetOrganizationMethod = + getGetOrganizationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetOrganization")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.GetOrganizationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.Organization + .getDefaultInstance())) + .setSchemaDescriptor( + new OrganizationsMethodDescriptorSupplier("GetOrganization")) + .build(); + } + } + } + return getGetOrganizationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest, + com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse> + getSearchOrganizationsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SearchOrganizations", + requestType = com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest.class, + responseType = com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest, + com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse> + getSearchOrganizationsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest, + com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse> + getSearchOrganizationsMethod; + if ((getSearchOrganizationsMethod = OrganizationsGrpc.getSearchOrganizationsMethod) == null) { + synchronized (OrganizationsGrpc.class) { + if ((getSearchOrganizationsMethod = OrganizationsGrpc.getSearchOrganizationsMethod) + == null) { + OrganizationsGrpc.getSearchOrganizationsMethod = + getSearchOrganizationsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "SearchOrganizations")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new OrganizationsMethodDescriptorSupplier("SearchOrganizations")) + .build(); + } + } + } + return getSearchOrganizationsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetIamPolicy", + requestType = com.google.iam.v1.GetIamPolicyRequest.class, + responseType = com.google.iam.v1.Policy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod() { + io.grpc.MethodDescriptor + getGetIamPolicyMethod; + if ((getGetIamPolicyMethod = OrganizationsGrpc.getGetIamPolicyMethod) == null) { + synchronized (OrganizationsGrpc.class) { + if ((getGetIamPolicyMethod = OrganizationsGrpc.getGetIamPolicyMethod) == null) { + OrganizationsGrpc.getGetIamPolicyMethod = + getGetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor( + new OrganizationsMethodDescriptorSupplier("GetIamPolicy")) + .build(); + } + } + } + return getGetIamPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetIamPolicy", + requestType = com.google.iam.v1.SetIamPolicyRequest.class, + responseType = com.google.iam.v1.Policy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod() { + io.grpc.MethodDescriptor + getSetIamPolicyMethod; + if ((getSetIamPolicyMethod = OrganizationsGrpc.getSetIamPolicyMethod) == null) { + synchronized (OrganizationsGrpc.class) { + if ((getSetIamPolicyMethod = OrganizationsGrpc.getSetIamPolicyMethod) == null) { + OrganizationsGrpc.getSetIamPolicyMethod = + getSetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor( + new OrganizationsMethodDescriptorSupplier("SetIamPolicy")) + .build(); + } + } + } + return getSetIamPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "TestIamPermissions", + requestType = com.google.iam.v1.TestIamPermissionsRequest.class, + responseType = com.google.iam.v1.TestIamPermissionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + if ((getTestIamPermissionsMethod = OrganizationsGrpc.getTestIamPermissionsMethod) == null) { + synchronized (OrganizationsGrpc.class) { + if ((getTestIamPermissionsMethod = OrganizationsGrpc.getTestIamPermissionsMethod) == null) { + OrganizationsGrpc.getTestIamPermissionsMethod = + getTestIamPermissionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "TestIamPermissions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new OrganizationsMethodDescriptorSupplier("TestIamPermissions")) + .build(); + } + } + } + return getTestIamPermissionsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static OrganizationsStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public OrganizationsStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new OrganizationsStub(channel, callOptions); + } + }; + return OrganizationsStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static OrganizationsBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public OrganizationsBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new OrganizationsBlockingStub(channel, callOptions); + } + }; + return OrganizationsBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static OrganizationsFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public OrganizationsFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new OrganizationsFutureStub(channel, callOptions); + } + }; + return OrganizationsFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Allows users to manage their organization resources.
+   * 
+ */ + public abstract static class OrganizationsImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Fetches an organization resource identified by the specified resource name.
+     * 
+ */ + public void getOrganization( + com.google.cloud.resourcemanager.v3.GetOrganizationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetOrganizationMethod(), responseObserver); + } + + /** + * + * + *
+     * 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`
+     * 
+ */ + public void searchOrganizations( + com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSearchOrganizationsMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetIamPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSetIamPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getTestIamPermissionsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetOrganizationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.GetOrganizationRequest, + com.google.cloud.resourcemanager.v3.Organization>( + this, METHODID_GET_ORGANIZATION))) + .addMethod( + getSearchOrganizationsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest, + com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse>( + this, METHODID_SEARCH_ORGANIZATIONS))) + .addMethod( + getGetIamPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_GET_IAM_POLICY))) + .addMethod( + getSetIamPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_SET_IAM_POLICY))) + .addMethod( + getTestIamPermissionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse>( + this, METHODID_TEST_IAM_PERMISSIONS))) + .build(); + } + } + + /** + * + * + *
+   * Allows users to manage their organization resources.
+   * 
+ */ + public static final class OrganizationsStub + extends io.grpc.stub.AbstractAsyncStub { + private OrganizationsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected OrganizationsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new OrganizationsStub(channel, callOptions); + } + + /** + * + * + *
+     * Fetches an organization resource identified by the specified resource name.
+     * 
+ */ + public void getOrganization( + com.google.cloud.resourcemanager.v3.GetOrganizationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetOrganizationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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`
+     * 
+ */ + public void searchOrganizations( + com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSearchOrganizationsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Allows users to manage their organization resources.
+   * 
+ */ + public static final class OrganizationsBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private OrganizationsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected OrganizationsBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new OrganizationsBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Fetches an organization resource identified by the specified resource name.
+     * 
+ */ + public com.google.cloud.resourcemanager.v3.Organization getOrganization( + com.google.cloud.resourcemanager.v3.GetOrganizationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetOrganizationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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`
+     * 
+ */ + public com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse searchOrganizations( + com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSearchOrganizationsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetIamPolicyMethod(), getCallOptions(), 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.
+     * 
+ */ + public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getTestIamPermissionsMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Allows users to manage their organization resources.
+   * 
+ */ + public static final class OrganizationsFutureStub + extends io.grpc.stub.AbstractFutureStub { + private OrganizationsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected OrganizationsFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new OrganizationsFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Fetches an organization resource identified by the specified resource name.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.resourcemanager.v3.Organization> + getOrganization(com.google.cloud.resourcemanager.v3.GetOrganizationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetOrganizationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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`
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse> + searchOrganizations( + com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSearchOrganizationsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v1.TestIamPermissionsResponse> + testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_ORGANIZATION = 0; + private static final int METHODID_SEARCH_ORGANIZATIONS = 1; + private static final int METHODID_GET_IAM_POLICY = 2; + private static final int METHODID_SET_IAM_POLICY = 3; + private static final int METHODID_TEST_IAM_PERMISSIONS = 4; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final OrganizationsImplBase serviceImpl; + private final int methodId; + + MethodHandlers(OrganizationsImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_GET_ORGANIZATION: + serviceImpl.getOrganization( + (com.google.cloud.resourcemanager.v3.GetOrganizationRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_SEARCH_ORGANIZATIONS: + serviceImpl.searchOrganizations( + (com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse>) + responseObserver); + break; + case METHODID_GET_IAM_POLICY: + serviceImpl.getIamPolicy( + (com.google.iam.v1.GetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_IAM_POLICY: + serviceImpl.setIamPolicy( + (com.google.iam.v1.SetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_TEST_IAM_PERMISSIONS: + serviceImpl.testIamPermissions( + (com.google.iam.v1.TestIamPermissionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class OrganizationsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + OrganizationsBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Organizations"); + } + } + + private static final class OrganizationsFileDescriptorSupplier + extends OrganizationsBaseDescriptorSupplier { + OrganizationsFileDescriptorSupplier() {} + } + + private static final class OrganizationsMethodDescriptorSupplier + extends OrganizationsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + OrganizationsMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (OrganizationsGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new OrganizationsFileDescriptorSupplier()) + .addMethod(getGetOrganizationMethod()) + .addMethod(getSearchOrganizationsMethod()) + .addMethod(getGetIamPolicyMethod()) + .addMethod(getSetIamPolicyMethod()) + .addMethod(getTestIamPermissionsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-resourcemanager/grpc-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ProjectsGrpc.java b/java-resourcemanager/grpc-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ProjectsGrpc.java new file mode 100644 index 000000000000..9e4c68caf6fe --- /dev/null +++ b/java-resourcemanager/grpc-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ProjectsGrpc.java @@ -0,0 +1,1871 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.resourcemanager.v3; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Manages Google Cloud Projects.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/resourcemanager/v3/projects.proto") +public final class ProjectsGrpc { + + private ProjectsGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.resourcemanager.v3.Projects"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.GetProjectRequest, + com.google.cloud.resourcemanager.v3.Project> + getGetProjectMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetProject", + requestType = com.google.cloud.resourcemanager.v3.GetProjectRequest.class, + responseType = com.google.cloud.resourcemanager.v3.Project.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.GetProjectRequest, + com.google.cloud.resourcemanager.v3.Project> + getGetProjectMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.GetProjectRequest, + com.google.cloud.resourcemanager.v3.Project> + getGetProjectMethod; + if ((getGetProjectMethod = ProjectsGrpc.getGetProjectMethod) == null) { + synchronized (ProjectsGrpc.class) { + if ((getGetProjectMethod = ProjectsGrpc.getGetProjectMethod) == null) { + ProjectsGrpc.getGetProjectMethod = + getGetProjectMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetProject")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.GetProjectRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.Project.getDefaultInstance())) + .setSchemaDescriptor(new ProjectsMethodDescriptorSupplier("GetProject")) + .build(); + } + } + } + return getGetProjectMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.ListProjectsRequest, + com.google.cloud.resourcemanager.v3.ListProjectsResponse> + getListProjectsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListProjects", + requestType = com.google.cloud.resourcemanager.v3.ListProjectsRequest.class, + responseType = com.google.cloud.resourcemanager.v3.ListProjectsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.ListProjectsRequest, + com.google.cloud.resourcemanager.v3.ListProjectsResponse> + getListProjectsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.ListProjectsRequest, + com.google.cloud.resourcemanager.v3.ListProjectsResponse> + getListProjectsMethod; + if ((getListProjectsMethod = ProjectsGrpc.getListProjectsMethod) == null) { + synchronized (ProjectsGrpc.class) { + if ((getListProjectsMethod = ProjectsGrpc.getListProjectsMethod) == null) { + ProjectsGrpc.getListProjectsMethod = + getListProjectsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListProjects")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.ListProjectsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.ListProjectsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new ProjectsMethodDescriptorSupplier("ListProjects")) + .build(); + } + } + } + return getListProjectsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.SearchProjectsRequest, + com.google.cloud.resourcemanager.v3.SearchProjectsResponse> + getSearchProjectsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SearchProjects", + requestType = com.google.cloud.resourcemanager.v3.SearchProjectsRequest.class, + responseType = com.google.cloud.resourcemanager.v3.SearchProjectsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.SearchProjectsRequest, + com.google.cloud.resourcemanager.v3.SearchProjectsResponse> + getSearchProjectsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.SearchProjectsRequest, + com.google.cloud.resourcemanager.v3.SearchProjectsResponse> + getSearchProjectsMethod; + if ((getSearchProjectsMethod = ProjectsGrpc.getSearchProjectsMethod) == null) { + synchronized (ProjectsGrpc.class) { + if ((getSearchProjectsMethod = ProjectsGrpc.getSearchProjectsMethod) == null) { + ProjectsGrpc.getSearchProjectsMethod = + getSearchProjectsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SearchProjects")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.SearchProjectsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.SearchProjectsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new ProjectsMethodDescriptorSupplier("SearchProjects")) + .build(); + } + } + } + return getSearchProjectsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.CreateProjectRequest, + com.google.longrunning.Operation> + getCreateProjectMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateProject", + requestType = com.google.cloud.resourcemanager.v3.CreateProjectRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.CreateProjectRequest, + com.google.longrunning.Operation> + getCreateProjectMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.CreateProjectRequest, + com.google.longrunning.Operation> + getCreateProjectMethod; + if ((getCreateProjectMethod = ProjectsGrpc.getCreateProjectMethod) == null) { + synchronized (ProjectsGrpc.class) { + if ((getCreateProjectMethod = ProjectsGrpc.getCreateProjectMethod) == null) { + ProjectsGrpc.getCreateProjectMethod = + getCreateProjectMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateProject")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.CreateProjectRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new ProjectsMethodDescriptorSupplier("CreateProject")) + .build(); + } + } + } + return getCreateProjectMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.UpdateProjectRequest, + com.google.longrunning.Operation> + getUpdateProjectMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateProject", + requestType = com.google.cloud.resourcemanager.v3.UpdateProjectRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.UpdateProjectRequest, + com.google.longrunning.Operation> + getUpdateProjectMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.UpdateProjectRequest, + com.google.longrunning.Operation> + getUpdateProjectMethod; + if ((getUpdateProjectMethod = ProjectsGrpc.getUpdateProjectMethod) == null) { + synchronized (ProjectsGrpc.class) { + if ((getUpdateProjectMethod = ProjectsGrpc.getUpdateProjectMethod) == null) { + ProjectsGrpc.getUpdateProjectMethod = + getUpdateProjectMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateProject")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.UpdateProjectRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new ProjectsMethodDescriptorSupplier("UpdateProject")) + .build(); + } + } + } + return getUpdateProjectMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.MoveProjectRequest, com.google.longrunning.Operation> + getMoveProjectMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "MoveProject", + requestType = com.google.cloud.resourcemanager.v3.MoveProjectRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.MoveProjectRequest, com.google.longrunning.Operation> + getMoveProjectMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.MoveProjectRequest, + com.google.longrunning.Operation> + getMoveProjectMethod; + if ((getMoveProjectMethod = ProjectsGrpc.getMoveProjectMethod) == null) { + synchronized (ProjectsGrpc.class) { + if ((getMoveProjectMethod = ProjectsGrpc.getMoveProjectMethod) == null) { + ProjectsGrpc.getMoveProjectMethod = + getMoveProjectMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "MoveProject")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.MoveProjectRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new ProjectsMethodDescriptorSupplier("MoveProject")) + .build(); + } + } + } + return getMoveProjectMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.DeleteProjectRequest, + com.google.longrunning.Operation> + getDeleteProjectMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteProject", + requestType = com.google.cloud.resourcemanager.v3.DeleteProjectRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.DeleteProjectRequest, + com.google.longrunning.Operation> + getDeleteProjectMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.DeleteProjectRequest, + com.google.longrunning.Operation> + getDeleteProjectMethod; + if ((getDeleteProjectMethod = ProjectsGrpc.getDeleteProjectMethod) == null) { + synchronized (ProjectsGrpc.class) { + if ((getDeleteProjectMethod = ProjectsGrpc.getDeleteProjectMethod) == null) { + ProjectsGrpc.getDeleteProjectMethod = + getDeleteProjectMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteProject")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.DeleteProjectRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new ProjectsMethodDescriptorSupplier("DeleteProject")) + .build(); + } + } + } + return getDeleteProjectMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.UndeleteProjectRequest, + com.google.longrunning.Operation> + getUndeleteProjectMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UndeleteProject", + requestType = com.google.cloud.resourcemanager.v3.UndeleteProjectRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.UndeleteProjectRequest, + com.google.longrunning.Operation> + getUndeleteProjectMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.UndeleteProjectRequest, + com.google.longrunning.Operation> + getUndeleteProjectMethod; + if ((getUndeleteProjectMethod = ProjectsGrpc.getUndeleteProjectMethod) == null) { + synchronized (ProjectsGrpc.class) { + if ((getUndeleteProjectMethod = ProjectsGrpc.getUndeleteProjectMethod) == null) { + ProjectsGrpc.getUndeleteProjectMethod = + getUndeleteProjectMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UndeleteProject")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.UndeleteProjectRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new ProjectsMethodDescriptorSupplier("UndeleteProject")) + .build(); + } + } + } + return getUndeleteProjectMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetIamPolicy", + requestType = com.google.iam.v1.GetIamPolicyRequest.class, + responseType = com.google.iam.v1.Policy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod() { + io.grpc.MethodDescriptor + getGetIamPolicyMethod; + if ((getGetIamPolicyMethod = ProjectsGrpc.getGetIamPolicyMethod) == null) { + synchronized (ProjectsGrpc.class) { + if ((getGetIamPolicyMethod = ProjectsGrpc.getGetIamPolicyMethod) == null) { + ProjectsGrpc.getGetIamPolicyMethod = + getGetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor(new ProjectsMethodDescriptorSupplier("GetIamPolicy")) + .build(); + } + } + } + return getGetIamPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetIamPolicy", + requestType = com.google.iam.v1.SetIamPolicyRequest.class, + responseType = com.google.iam.v1.Policy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod() { + io.grpc.MethodDescriptor + getSetIamPolicyMethod; + if ((getSetIamPolicyMethod = ProjectsGrpc.getSetIamPolicyMethod) == null) { + synchronized (ProjectsGrpc.class) { + if ((getSetIamPolicyMethod = ProjectsGrpc.getSetIamPolicyMethod) == null) { + ProjectsGrpc.getSetIamPolicyMethod = + getSetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor(new ProjectsMethodDescriptorSupplier("SetIamPolicy")) + .build(); + } + } + } + return getSetIamPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "TestIamPermissions", + requestType = com.google.iam.v1.TestIamPermissionsRequest.class, + responseType = com.google.iam.v1.TestIamPermissionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + if ((getTestIamPermissionsMethod = ProjectsGrpc.getTestIamPermissionsMethod) == null) { + synchronized (ProjectsGrpc.class) { + if ((getTestIamPermissionsMethod = ProjectsGrpc.getTestIamPermissionsMethod) == null) { + ProjectsGrpc.getTestIamPermissionsMethod = + getTestIamPermissionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "TestIamPermissions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ProjectsMethodDescriptorSupplier("TestIamPermissions")) + .build(); + } + } + } + return getTestIamPermissionsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ProjectsStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ProjectsStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ProjectsStub(channel, callOptions); + } + }; + return ProjectsStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ProjectsBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ProjectsBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ProjectsBlockingStub(channel, callOptions); + } + }; + return ProjectsBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ProjectsFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ProjectsFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ProjectsFutureStub(channel, callOptions); + } + }; + return ProjectsFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Manages Google Cloud Projects.
+   * 
+ */ + public abstract static class ProjectsImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Retrieves the project identified by the specified `name` (for example,
+     * `projects/415104041262`).
+     * The caller must have `resourcemanager.projects.get` permission
+     * for this project.
+     * 
+ */ + public void getProject( + com.google.cloud.resourcemanager.v3.GetProjectRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetProjectMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void listProjects( + com.google.cloud.resourcemanager.v3.ListProjectsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListProjectsMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void searchProjects( + com.google.cloud.resourcemanager.v3.SearchProjectsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSearchProjectsMethod(), responseObserver); + } + + /** + * + * + *
+     * 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`.
+     * 
+ */ + public void createProject( + com.google.cloud.resourcemanager.v3.CreateProjectRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateProjectMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void updateProject( + com.google.cloud.resourcemanager.v3.UpdateProjectRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateProjectMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.update` permission on the
+     * project and have `resourcemanager.projects.move` permission on the
+     * project's current and proposed new parent.
+     * 
+ */ + public void moveProject( + com.google.cloud.resourcemanager.v3.MoveProjectRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getMoveProjectMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void deleteProject( + com.google.cloud.resourcemanager.v3.DeleteProjectRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteProjectMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void undeleteProject( + com.google.cloud.resourcemanager.v3.UndeleteProjectRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUndeleteProjectMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns the IAM access control policy for the specified project.
+     * Permission is denied if the policy or the resource do not exist.
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetIamPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Sets the IAM access control policy for the specified project.
+     * 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.
+     * + Membership changes that leave the project without any owners that have
+     * accepted the Terms of Service (ToS) will be rejected.
+     * + 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.
+     * + Calling this method requires enabling the App Engine Admin API.
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSetIamPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns permissions that a caller has on the specified project.
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getTestIamPermissionsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetProjectMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.GetProjectRequest, + com.google.cloud.resourcemanager.v3.Project>(this, METHODID_GET_PROJECT))) + .addMethod( + getListProjectsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.ListProjectsRequest, + com.google.cloud.resourcemanager.v3.ListProjectsResponse>( + this, METHODID_LIST_PROJECTS))) + .addMethod( + getSearchProjectsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.SearchProjectsRequest, + com.google.cloud.resourcemanager.v3.SearchProjectsResponse>( + this, METHODID_SEARCH_PROJECTS))) + .addMethod( + getCreateProjectMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.CreateProjectRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_PROJECT))) + .addMethod( + getUpdateProjectMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.UpdateProjectRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_PROJECT))) + .addMethod( + getMoveProjectMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.MoveProjectRequest, + com.google.longrunning.Operation>(this, METHODID_MOVE_PROJECT))) + .addMethod( + getDeleteProjectMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.DeleteProjectRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_PROJECT))) + .addMethod( + getUndeleteProjectMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.UndeleteProjectRequest, + com.google.longrunning.Operation>(this, METHODID_UNDELETE_PROJECT))) + .addMethod( + getGetIamPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_GET_IAM_POLICY))) + .addMethod( + getSetIamPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_SET_IAM_POLICY))) + .addMethod( + getTestIamPermissionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse>( + this, METHODID_TEST_IAM_PERMISSIONS))) + .build(); + } + } + + /** + * + * + *
+   * Manages Google Cloud Projects.
+   * 
+ */ + public static final class ProjectsStub extends io.grpc.stub.AbstractAsyncStub { + private ProjectsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ProjectsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ProjectsStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves the project identified by the specified `name` (for example,
+     * `projects/415104041262`).
+     * The caller must have `resourcemanager.projects.get` permission
+     * for this project.
+     * 
+ */ + public void getProject( + com.google.cloud.resourcemanager.v3.GetProjectRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetProjectMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void listProjects( + com.google.cloud.resourcemanager.v3.ListProjectsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListProjectsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void searchProjects( + com.google.cloud.resourcemanager.v3.SearchProjectsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSearchProjectsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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`.
+     * 
+ */ + public void createProject( + com.google.cloud.resourcemanager.v3.CreateProjectRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateProjectMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void updateProject( + com.google.cloud.resourcemanager.v3.UpdateProjectRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateProjectMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.update` permission on the
+     * project and have `resourcemanager.projects.move` permission on the
+     * project's current and proposed new parent.
+     * 
+ */ + public void moveProject( + com.google.cloud.resourcemanager.v3.MoveProjectRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getMoveProjectMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void deleteProject( + com.google.cloud.resourcemanager.v3.DeleteProjectRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteProjectMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void undeleteProject( + com.google.cloud.resourcemanager.v3.UndeleteProjectRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUndeleteProjectMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns the IAM access control policy for the specified project.
+     * Permission is denied if the policy or the resource do not exist.
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Sets the IAM access control policy for the specified project.
+     * 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.
+     * + Membership changes that leave the project without any owners that have
+     * accepted the Terms of Service (ToS) will be rejected.
+     * + 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.
+     * + Calling this method requires enabling the App Engine Admin API.
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns permissions that a caller has on the specified project.
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Manages Google Cloud Projects.
+   * 
+ */ + public static final class ProjectsBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ProjectsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ProjectsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ProjectsBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves the project identified by the specified `name` (for example,
+     * `projects/415104041262`).
+     * The caller must have `resourcemanager.projects.get` permission
+     * for this project.
+     * 
+ */ + public com.google.cloud.resourcemanager.v3.Project getProject( + com.google.cloud.resourcemanager.v3.GetProjectRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetProjectMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.cloud.resourcemanager.v3.ListProjectsResponse listProjects( + com.google.cloud.resourcemanager.v3.ListProjectsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListProjectsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.cloud.resourcemanager.v3.SearchProjectsResponse searchProjects( + com.google.cloud.resourcemanager.v3.SearchProjectsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSearchProjectsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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`.
+     * 
+ */ + public com.google.longrunning.Operation createProject( + com.google.cloud.resourcemanager.v3.CreateProjectRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateProjectMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.longrunning.Operation updateProject( + com.google.cloud.resourcemanager.v3.UpdateProjectRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateProjectMethod(), getCallOptions(), 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.update` permission on the
+     * project and have `resourcemanager.projects.move` permission on the
+     * project's current and proposed new parent.
+     * 
+ */ + public com.google.longrunning.Operation moveProject( + com.google.cloud.resourcemanager.v3.MoveProjectRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getMoveProjectMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.longrunning.Operation deleteProject( + com.google.cloud.resourcemanager.v3.DeleteProjectRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteProjectMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.longrunning.Operation undeleteProject( + com.google.cloud.resourcemanager.v3.UndeleteProjectRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUndeleteProjectMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns the IAM access control policy for the specified project.
+     * Permission is denied if the policy or the resource do not exist.
+     * 
+ */ + public com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Sets the IAM access control policy for the specified project.
+     * 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.
+     * + Membership changes that leave the project without any owners that have
+     * accepted the Terms of Service (ToS) will be rejected.
+     * + 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.
+     * + Calling this method requires enabling the App Engine Admin API.
+     * 
+ */ + public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns permissions that a caller has on the specified project.
+     * 
+ */ + public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getTestIamPermissionsMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Manages Google Cloud Projects.
+   * 
+ */ + public static final class ProjectsFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ProjectsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ProjectsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ProjectsFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves the project identified by the specified `name` (for example,
+     * `projects/415104041262`).
+     * The caller must have `resourcemanager.projects.get` permission
+     * for this project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.resourcemanager.v3.Project> + getProject(com.google.cloud.resourcemanager.v3.GetProjectRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetProjectMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.resourcemanager.v3.ListProjectsResponse> + listProjects(com.google.cloud.resourcemanager.v3.ListProjectsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListProjectsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.resourcemanager.v3.SearchProjectsResponse> + searchProjects(com.google.cloud.resourcemanager.v3.SearchProjectsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSearchProjectsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createProject(com.google.cloud.resourcemanager.v3.CreateProjectRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateProjectMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateProject(com.google.cloud.resourcemanager.v3.UpdateProjectRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateProjectMethod(), getCallOptions()), 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.update` permission on the
+     * project and have `resourcemanager.projects.move` permission on the
+     * project's current and proposed new parent.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + moveProject(com.google.cloud.resourcemanager.v3.MoveProjectRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getMoveProjectMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteProject(com.google.cloud.resourcemanager.v3.DeleteProjectRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteProjectMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + undeleteProject(com.google.cloud.resourcemanager.v3.UndeleteProjectRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUndeleteProjectMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns the IAM access control policy for the specified project.
+     * Permission is denied if the policy or the resource do not exist.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Sets the IAM access control policy for the specified project.
+     * 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.
+     * + Membership changes that leave the project without any owners that have
+     * accepted the Terms of Service (ToS) will be rejected.
+     * + 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.
+     * + Calling this method requires enabling the App Engine Admin API.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns permissions that a caller has on the specified project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v1.TestIamPermissionsResponse> + testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_PROJECT = 0; + private static final int METHODID_LIST_PROJECTS = 1; + private static final int METHODID_SEARCH_PROJECTS = 2; + private static final int METHODID_CREATE_PROJECT = 3; + private static final int METHODID_UPDATE_PROJECT = 4; + private static final int METHODID_MOVE_PROJECT = 5; + private static final int METHODID_DELETE_PROJECT = 6; + private static final int METHODID_UNDELETE_PROJECT = 7; + private static final int METHODID_GET_IAM_POLICY = 8; + private static final int METHODID_SET_IAM_POLICY = 9; + private static final int METHODID_TEST_IAM_PERMISSIONS = 10; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final ProjectsImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ProjectsImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_GET_PROJECT: + serviceImpl.getProject( + (com.google.cloud.resourcemanager.v3.GetProjectRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_PROJECTS: + serviceImpl.listProjects( + (com.google.cloud.resourcemanager.v3.ListProjectsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.resourcemanager.v3.ListProjectsResponse>) + responseObserver); + break; + case METHODID_SEARCH_PROJECTS: + serviceImpl.searchProjects( + (com.google.cloud.resourcemanager.v3.SearchProjectsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.resourcemanager.v3.SearchProjectsResponse>) + responseObserver); + break; + case METHODID_CREATE_PROJECT: + serviceImpl.createProject( + (com.google.cloud.resourcemanager.v3.CreateProjectRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_PROJECT: + serviceImpl.updateProject( + (com.google.cloud.resourcemanager.v3.UpdateProjectRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_MOVE_PROJECT: + serviceImpl.moveProject( + (com.google.cloud.resourcemanager.v3.MoveProjectRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_PROJECT: + serviceImpl.deleteProject( + (com.google.cloud.resourcemanager.v3.DeleteProjectRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UNDELETE_PROJECT: + serviceImpl.undeleteProject( + (com.google.cloud.resourcemanager.v3.UndeleteProjectRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_IAM_POLICY: + serviceImpl.getIamPolicy( + (com.google.iam.v1.GetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_IAM_POLICY: + serviceImpl.setIamPolicy( + (com.google.iam.v1.SetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_TEST_IAM_PERMISSIONS: + serviceImpl.testIamPermissions( + (com.google.iam.v1.TestIamPermissionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class ProjectsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ProjectsBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Projects"); + } + } + + private static final class ProjectsFileDescriptorSupplier extends ProjectsBaseDescriptorSupplier { + ProjectsFileDescriptorSupplier() {} + } + + private static final class ProjectsMethodDescriptorSupplier extends ProjectsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ProjectsMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (ProjectsGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ProjectsFileDescriptorSupplier()) + .addMethod(getGetProjectMethod()) + .addMethod(getListProjectsMethod()) + .addMethod(getSearchProjectsMethod()) + .addMethod(getCreateProjectMethod()) + .addMethod(getUpdateProjectMethod()) + .addMethod(getMoveProjectMethod()) + .addMethod(getDeleteProjectMethod()) + .addMethod(getUndeleteProjectMethod()) + .addMethod(getGetIamPolicyMethod()) + .addMethod(getSetIamPolicyMethod()) + .addMethod(getTestIamPermissionsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-resourcemanager/grpc-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagBindingsGrpc.java b/java-resourcemanager/grpc-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagBindingsGrpc.java new file mode 100644 index 000000000000..16c01870ad9a --- /dev/null +++ b/java-resourcemanager/grpc-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagBindingsGrpc.java @@ -0,0 +1,613 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.resourcemanager.v3; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Allow users to create and manage TagBindings between TagValues and
+ * different cloud resources throughout the GCP resource hierarchy.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/resourcemanager/v3/tag_bindings.proto") +public final class TagBindingsGrpc { + + private TagBindingsGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.resourcemanager.v3.TagBindings"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.ListTagBindingsRequest, + com.google.cloud.resourcemanager.v3.ListTagBindingsResponse> + getListTagBindingsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListTagBindings", + requestType = com.google.cloud.resourcemanager.v3.ListTagBindingsRequest.class, + responseType = com.google.cloud.resourcemanager.v3.ListTagBindingsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.ListTagBindingsRequest, + com.google.cloud.resourcemanager.v3.ListTagBindingsResponse> + getListTagBindingsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.ListTagBindingsRequest, + com.google.cloud.resourcemanager.v3.ListTagBindingsResponse> + getListTagBindingsMethod; + if ((getListTagBindingsMethod = TagBindingsGrpc.getListTagBindingsMethod) == null) { + synchronized (TagBindingsGrpc.class) { + if ((getListTagBindingsMethod = TagBindingsGrpc.getListTagBindingsMethod) == null) { + TagBindingsGrpc.getListTagBindingsMethod = + getListTagBindingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListTagBindings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.ListTagBindingsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.ListTagBindingsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new TagBindingsMethodDescriptorSupplier("ListTagBindings")) + .build(); + } + } + } + return getListTagBindingsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.CreateTagBindingRequest, + com.google.longrunning.Operation> + getCreateTagBindingMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateTagBinding", + requestType = com.google.cloud.resourcemanager.v3.CreateTagBindingRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.CreateTagBindingRequest, + com.google.longrunning.Operation> + getCreateTagBindingMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.CreateTagBindingRequest, + com.google.longrunning.Operation> + getCreateTagBindingMethod; + if ((getCreateTagBindingMethod = TagBindingsGrpc.getCreateTagBindingMethod) == null) { + synchronized (TagBindingsGrpc.class) { + if ((getCreateTagBindingMethod = TagBindingsGrpc.getCreateTagBindingMethod) == null) { + TagBindingsGrpc.getCreateTagBindingMethod = + getCreateTagBindingMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateTagBinding")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.CreateTagBindingRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new TagBindingsMethodDescriptorSupplier("CreateTagBinding")) + .build(); + } + } + } + return getCreateTagBindingMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest, + com.google.longrunning.Operation> + getDeleteTagBindingMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteTagBinding", + requestType = com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest, + com.google.longrunning.Operation> + getDeleteTagBindingMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest, + com.google.longrunning.Operation> + getDeleteTagBindingMethod; + if ((getDeleteTagBindingMethod = TagBindingsGrpc.getDeleteTagBindingMethod) == null) { + synchronized (TagBindingsGrpc.class) { + if ((getDeleteTagBindingMethod = TagBindingsGrpc.getDeleteTagBindingMethod) == null) { + TagBindingsGrpc.getDeleteTagBindingMethod = + getDeleteTagBindingMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteTagBinding")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new TagBindingsMethodDescriptorSupplier("DeleteTagBinding")) + .build(); + } + } + } + return getDeleteTagBindingMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static TagBindingsStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TagBindingsStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TagBindingsStub(channel, callOptions); + } + }; + return TagBindingsStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static TagBindingsBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TagBindingsBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TagBindingsBlockingStub(channel, callOptions); + } + }; + return TagBindingsBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static TagBindingsFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TagBindingsFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TagBindingsFutureStub(channel, callOptions); + } + }; + return TagBindingsFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Allow users to create and manage TagBindings between TagValues and
+   * different cloud resources throughout the GCP resource hierarchy.
+   * 
+ */ + public abstract static class TagBindingsImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists the TagBindings for the given 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
+     * 
+ */ + public void listTagBindings( + com.google.cloud.resourcemanager.v3.ListTagBindingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListTagBindingsMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a TagBinding between a TagValue and a cloud resource
+     * (currently project, folder, or organization).
+     * 
+ */ + public void createTagBinding( + com.google.cloud.resourcemanager.v3.CreateTagBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateTagBindingMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a TagBinding.
+     * 
+ */ + public void deleteTagBinding( + com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteTagBindingMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListTagBindingsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.ListTagBindingsRequest, + com.google.cloud.resourcemanager.v3.ListTagBindingsResponse>( + this, METHODID_LIST_TAG_BINDINGS))) + .addMethod( + getCreateTagBindingMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.CreateTagBindingRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_TAG_BINDING))) + .addMethod( + getDeleteTagBindingMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_TAG_BINDING))) + .build(); + } + } + + /** + * + * + *
+   * Allow users to create and manage TagBindings between TagValues and
+   * different cloud resources throughout the GCP resource hierarchy.
+   * 
+ */ + public static final class TagBindingsStub + extends io.grpc.stub.AbstractAsyncStub { + private TagBindingsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TagBindingsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TagBindingsStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists the TagBindings for the given 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
+     * 
+ */ + public void listTagBindings( + com.google.cloud.resourcemanager.v3.ListTagBindingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListTagBindingsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a TagBinding between a TagValue and a cloud resource
+     * (currently project, folder, or organization).
+     * 
+ */ + public void createTagBinding( + com.google.cloud.resourcemanager.v3.CreateTagBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateTagBindingMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a TagBinding.
+     * 
+ */ + public void deleteTagBinding( + com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteTagBindingMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Allow users to create and manage TagBindings between TagValues and
+   * different cloud resources throughout the GCP resource hierarchy.
+   * 
+ */ + public static final class TagBindingsBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private TagBindingsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TagBindingsBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TagBindingsBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists the TagBindings for the given 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
+     * 
+ */ + public com.google.cloud.resourcemanager.v3.ListTagBindingsResponse listTagBindings( + com.google.cloud.resourcemanager.v3.ListTagBindingsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListTagBindingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a TagBinding between a TagValue and a cloud resource
+     * (currently project, folder, or organization).
+     * 
+ */ + public com.google.longrunning.Operation createTagBinding( + com.google.cloud.resourcemanager.v3.CreateTagBindingRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateTagBindingMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a TagBinding.
+     * 
+ */ + public com.google.longrunning.Operation deleteTagBinding( + com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteTagBindingMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Allow users to create and manage TagBindings between TagValues and
+   * different cloud resources throughout the GCP resource hierarchy.
+   * 
+ */ + public static final class TagBindingsFutureStub + extends io.grpc.stub.AbstractFutureStub { + private TagBindingsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TagBindingsFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TagBindingsFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists the TagBindings for the given 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
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.resourcemanager.v3.ListTagBindingsResponse> + listTagBindings(com.google.cloud.resourcemanager.v3.ListTagBindingsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListTagBindingsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a TagBinding between a TagValue and a cloud resource
+     * (currently project, folder, or organization).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createTagBinding(com.google.cloud.resourcemanager.v3.CreateTagBindingRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateTagBindingMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a TagBinding.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteTagBinding(com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteTagBindingMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_TAG_BINDINGS = 0; + private static final int METHODID_CREATE_TAG_BINDING = 1; + private static final int METHODID_DELETE_TAG_BINDING = 2; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final TagBindingsImplBase serviceImpl; + private final int methodId; + + MethodHandlers(TagBindingsImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_TAG_BINDINGS: + serviceImpl.listTagBindings( + (com.google.cloud.resourcemanager.v3.ListTagBindingsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.resourcemanager.v3.ListTagBindingsResponse>) + responseObserver); + break; + case METHODID_CREATE_TAG_BINDING: + serviceImpl.createTagBinding( + (com.google.cloud.resourcemanager.v3.CreateTagBindingRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_TAG_BINDING: + serviceImpl.deleteTagBinding( + (com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class TagBindingsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + TagBindingsBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("TagBindings"); + } + } + + private static final class TagBindingsFileDescriptorSupplier + extends TagBindingsBaseDescriptorSupplier { + TagBindingsFileDescriptorSupplier() {} + } + + private static final class TagBindingsMethodDescriptorSupplier + extends TagBindingsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + TagBindingsMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (TagBindingsGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new TagBindingsFileDescriptorSupplier()) + .addMethod(getListTagBindingsMethod()) + .addMethod(getCreateTagBindingMethod()) + .addMethod(getDeleteTagBindingMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-resourcemanager/grpc-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagKeysGrpc.java b/java-resourcemanager/grpc-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagKeysGrpc.java new file mode 100644 index 000000000000..1aedc13225ed --- /dev/null +++ b/java-resourcemanager/grpc-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagKeysGrpc.java @@ -0,0 +1,1201 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.resourcemanager.v3; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Allow users to create and manage tag keys.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/resourcemanager/v3/tag_keys.proto") +public final class TagKeysGrpc { + + private TagKeysGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.resourcemanager.v3.TagKeys"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.ListTagKeysRequest, + com.google.cloud.resourcemanager.v3.ListTagKeysResponse> + getListTagKeysMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListTagKeys", + requestType = com.google.cloud.resourcemanager.v3.ListTagKeysRequest.class, + responseType = com.google.cloud.resourcemanager.v3.ListTagKeysResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.ListTagKeysRequest, + com.google.cloud.resourcemanager.v3.ListTagKeysResponse> + getListTagKeysMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.ListTagKeysRequest, + com.google.cloud.resourcemanager.v3.ListTagKeysResponse> + getListTagKeysMethod; + if ((getListTagKeysMethod = TagKeysGrpc.getListTagKeysMethod) == null) { + synchronized (TagKeysGrpc.class) { + if ((getListTagKeysMethod = TagKeysGrpc.getListTagKeysMethod) == null) { + TagKeysGrpc.getListTagKeysMethod = + getListTagKeysMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListTagKeys")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.ListTagKeysRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.ListTagKeysResponse + .getDefaultInstance())) + .setSchemaDescriptor(new TagKeysMethodDescriptorSupplier("ListTagKeys")) + .build(); + } + } + } + return getListTagKeysMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.GetTagKeyRequest, + com.google.cloud.resourcemanager.v3.TagKey> + getGetTagKeyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetTagKey", + requestType = com.google.cloud.resourcemanager.v3.GetTagKeyRequest.class, + responseType = com.google.cloud.resourcemanager.v3.TagKey.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.GetTagKeyRequest, + com.google.cloud.resourcemanager.v3.TagKey> + getGetTagKeyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.GetTagKeyRequest, + com.google.cloud.resourcemanager.v3.TagKey> + getGetTagKeyMethod; + if ((getGetTagKeyMethod = TagKeysGrpc.getGetTagKeyMethod) == null) { + synchronized (TagKeysGrpc.class) { + if ((getGetTagKeyMethod = TagKeysGrpc.getGetTagKeyMethod) == null) { + TagKeysGrpc.getGetTagKeyMethod = + getGetTagKeyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetTagKey")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.GetTagKeyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.TagKey.getDefaultInstance())) + .setSchemaDescriptor(new TagKeysMethodDescriptorSupplier("GetTagKey")) + .build(); + } + } + } + return getGetTagKeyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.CreateTagKeyRequest, com.google.longrunning.Operation> + getCreateTagKeyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateTagKey", + requestType = com.google.cloud.resourcemanager.v3.CreateTagKeyRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.CreateTagKeyRequest, com.google.longrunning.Operation> + getCreateTagKeyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.CreateTagKeyRequest, + com.google.longrunning.Operation> + getCreateTagKeyMethod; + if ((getCreateTagKeyMethod = TagKeysGrpc.getCreateTagKeyMethod) == null) { + synchronized (TagKeysGrpc.class) { + if ((getCreateTagKeyMethod = TagKeysGrpc.getCreateTagKeyMethod) == null) { + TagKeysGrpc.getCreateTagKeyMethod = + getCreateTagKeyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateTagKey")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.CreateTagKeyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new TagKeysMethodDescriptorSupplier("CreateTagKey")) + .build(); + } + } + } + return getCreateTagKeyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest, com.google.longrunning.Operation> + getUpdateTagKeyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateTagKey", + requestType = com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest, com.google.longrunning.Operation> + getUpdateTagKeyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest, + com.google.longrunning.Operation> + getUpdateTagKeyMethod; + if ((getUpdateTagKeyMethod = TagKeysGrpc.getUpdateTagKeyMethod) == null) { + synchronized (TagKeysGrpc.class) { + if ((getUpdateTagKeyMethod = TagKeysGrpc.getUpdateTagKeyMethod) == null) { + TagKeysGrpc.getUpdateTagKeyMethod = + getUpdateTagKeyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateTagKey")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new TagKeysMethodDescriptorSupplier("UpdateTagKey")) + .build(); + } + } + } + return getUpdateTagKeyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest, com.google.longrunning.Operation> + getDeleteTagKeyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteTagKey", + requestType = com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest, com.google.longrunning.Operation> + getDeleteTagKeyMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest, + com.google.longrunning.Operation> + getDeleteTagKeyMethod; + if ((getDeleteTagKeyMethod = TagKeysGrpc.getDeleteTagKeyMethod) == null) { + synchronized (TagKeysGrpc.class) { + if ((getDeleteTagKeyMethod = TagKeysGrpc.getDeleteTagKeyMethod) == null) { + TagKeysGrpc.getDeleteTagKeyMethod = + getDeleteTagKeyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteTagKey")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new TagKeysMethodDescriptorSupplier("DeleteTagKey")) + .build(); + } + } + } + return getDeleteTagKeyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetIamPolicy", + requestType = com.google.iam.v1.GetIamPolicyRequest.class, + responseType = com.google.iam.v1.Policy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod() { + io.grpc.MethodDescriptor + getGetIamPolicyMethod; + if ((getGetIamPolicyMethod = TagKeysGrpc.getGetIamPolicyMethod) == null) { + synchronized (TagKeysGrpc.class) { + if ((getGetIamPolicyMethod = TagKeysGrpc.getGetIamPolicyMethod) == null) { + TagKeysGrpc.getGetIamPolicyMethod = + getGetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor(new TagKeysMethodDescriptorSupplier("GetIamPolicy")) + .build(); + } + } + } + return getGetIamPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetIamPolicy", + requestType = com.google.iam.v1.SetIamPolicyRequest.class, + responseType = com.google.iam.v1.Policy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod() { + io.grpc.MethodDescriptor + getSetIamPolicyMethod; + if ((getSetIamPolicyMethod = TagKeysGrpc.getSetIamPolicyMethod) == null) { + synchronized (TagKeysGrpc.class) { + if ((getSetIamPolicyMethod = TagKeysGrpc.getSetIamPolicyMethod) == null) { + TagKeysGrpc.getSetIamPolicyMethod = + getSetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor(new TagKeysMethodDescriptorSupplier("SetIamPolicy")) + .build(); + } + } + } + return getSetIamPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "TestIamPermissions", + requestType = com.google.iam.v1.TestIamPermissionsRequest.class, + responseType = com.google.iam.v1.TestIamPermissionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + if ((getTestIamPermissionsMethod = TagKeysGrpc.getTestIamPermissionsMethod) == null) { + synchronized (TagKeysGrpc.class) { + if ((getTestIamPermissionsMethod = TagKeysGrpc.getTestIamPermissionsMethod) == null) { + TagKeysGrpc.getTestIamPermissionsMethod = + getTestIamPermissionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "TestIamPermissions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new TagKeysMethodDescriptorSupplier("TestIamPermissions")) + .build(); + } + } + } + return getTestIamPermissionsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static TagKeysStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TagKeysStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TagKeysStub(channel, callOptions); + } + }; + return TagKeysStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static TagKeysBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TagKeysBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TagKeysBlockingStub(channel, callOptions); + } + }; + return TagKeysBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static TagKeysFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TagKeysFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TagKeysFutureStub(channel, callOptions); + } + }; + return TagKeysFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Allow users to create and manage tag keys.
+   * 
+ */ + public abstract static class TagKeysImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists all TagKeys for a parent resource.
+     * 
+ */ + public void listTagKeys( + com.google.cloud.resourcemanager.v3.ListTagKeysRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListTagKeysMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void getTagKey( + com.google.cloud.resourcemanager.v3.GetTagKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetTagKeyMethod(), responseObserver); + } + + /** + * + * + *
+     * 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 300 TagKeys can exist under a parent at
+     * any given time.
+     * 
+ */ + public void createTagKey( + com.google.cloud.resourcemanager.v3.CreateTagKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateTagKeyMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the attributes of the TagKey resource.
+     * 
+ */ + public void updateTagKey( + com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateTagKeyMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a TagKey. The TagKey cannot be deleted if it has any child
+     * TagValues.
+     * 
+ */ + public void deleteTagKey( + com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteTagKeyMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetIamPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSetIamPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getTestIamPermissionsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListTagKeysMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.ListTagKeysRequest, + com.google.cloud.resourcemanager.v3.ListTagKeysResponse>( + this, METHODID_LIST_TAG_KEYS))) + .addMethod( + getGetTagKeyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.GetTagKeyRequest, + com.google.cloud.resourcemanager.v3.TagKey>(this, METHODID_GET_TAG_KEY))) + .addMethod( + getCreateTagKeyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.CreateTagKeyRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_TAG_KEY))) + .addMethod( + getUpdateTagKeyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_TAG_KEY))) + .addMethod( + getDeleteTagKeyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_TAG_KEY))) + .addMethod( + getGetIamPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_GET_IAM_POLICY))) + .addMethod( + getSetIamPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_SET_IAM_POLICY))) + .addMethod( + getTestIamPermissionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse>( + this, METHODID_TEST_IAM_PERMISSIONS))) + .build(); + } + } + + /** + * + * + *
+   * Allow users to create and manage tag keys.
+   * 
+ */ + public static final class TagKeysStub extends io.grpc.stub.AbstractAsyncStub { + private TagKeysStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TagKeysStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TagKeysStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all TagKeys for a parent resource.
+     * 
+ */ + public void listTagKeys( + com.google.cloud.resourcemanager.v3.ListTagKeysRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListTagKeysMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void getTagKey( + com.google.cloud.resourcemanager.v3.GetTagKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetTagKeyMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * 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 300 TagKeys can exist under a parent at
+     * any given time.
+     * 
+ */ + public void createTagKey( + com.google.cloud.resourcemanager.v3.CreateTagKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateTagKeyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the attributes of the TagKey resource.
+     * 
+ */ + public void updateTagKey( + com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateTagKeyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a TagKey. The TagKey cannot be deleted if it has any child
+     * TagValues.
+     * 
+ */ + public void deleteTagKey( + com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteTagKeyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Allow users to create and manage tag keys.
+   * 
+ */ + public static final class TagKeysBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private TagKeysBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TagKeysBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TagKeysBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all TagKeys for a parent resource.
+     * 
+ */ + public com.google.cloud.resourcemanager.v3.ListTagKeysResponse listTagKeys( + com.google.cloud.resourcemanager.v3.ListTagKeysRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListTagKeysMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.cloud.resourcemanager.v3.TagKey getTagKey( + com.google.cloud.resourcemanager.v3.GetTagKeyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetTagKeyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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 300 TagKeys can exist under a parent at
+     * any given time.
+     * 
+ */ + public com.google.longrunning.Operation createTagKey( + com.google.cloud.resourcemanager.v3.CreateTagKeyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateTagKeyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the attributes of the TagKey resource.
+     * 
+ */ + public com.google.longrunning.Operation updateTagKey( + com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateTagKeyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a TagKey. The TagKey cannot be deleted if it has any child
+     * TagValues.
+     * 
+ */ + public com.google.longrunning.Operation deleteTagKey( + com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteTagKeyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetIamPolicyMethod(), getCallOptions(), 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.
+     * 
+ */ + public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getTestIamPermissionsMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Allow users to create and manage tag keys.
+   * 
+ */ + public static final class TagKeysFutureStub + extends io.grpc.stub.AbstractFutureStub { + private TagKeysFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TagKeysFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TagKeysFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all TagKeys for a parent resource.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.resourcemanager.v3.ListTagKeysResponse> + listTagKeys(com.google.cloud.resourcemanager.v3.ListTagKeysRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListTagKeysMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.resourcemanager.v3.TagKey> + getTagKey(com.google.cloud.resourcemanager.v3.GetTagKeyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetTagKeyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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 300 TagKeys can exist under a parent at
+     * any given time.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createTagKey(com.google.cloud.resourcemanager.v3.CreateTagKeyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateTagKeyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the attributes of the TagKey resource.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateTagKey(com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateTagKeyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a TagKey. The TagKey cannot be deleted if it has any child
+     * TagValues.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteTagKey(com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteTagKeyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v1.TestIamPermissionsResponse> + testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_TAG_KEYS = 0; + private static final int METHODID_GET_TAG_KEY = 1; + private static final int METHODID_CREATE_TAG_KEY = 2; + private static final int METHODID_UPDATE_TAG_KEY = 3; + private static final int METHODID_DELETE_TAG_KEY = 4; + private static final int METHODID_GET_IAM_POLICY = 5; + private static final int METHODID_SET_IAM_POLICY = 6; + private static final int METHODID_TEST_IAM_PERMISSIONS = 7; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final TagKeysImplBase serviceImpl; + private final int methodId; + + MethodHandlers(TagKeysImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_TAG_KEYS: + serviceImpl.listTagKeys( + (com.google.cloud.resourcemanager.v3.ListTagKeysRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_TAG_KEY: + serviceImpl.getTagKey( + (com.google.cloud.resourcemanager.v3.GetTagKeyRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_TAG_KEY: + serviceImpl.createTagKey( + (com.google.cloud.resourcemanager.v3.CreateTagKeyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_TAG_KEY: + serviceImpl.updateTagKey( + (com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_TAG_KEY: + serviceImpl.deleteTagKey( + (com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_IAM_POLICY: + serviceImpl.getIamPolicy( + (com.google.iam.v1.GetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_IAM_POLICY: + serviceImpl.setIamPolicy( + (com.google.iam.v1.SetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_TEST_IAM_PERMISSIONS: + serviceImpl.testIamPermissions( + (com.google.iam.v1.TestIamPermissionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class TagKeysBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + TagKeysBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.resourcemanager.v3.TagKeysProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("TagKeys"); + } + } + + private static final class TagKeysFileDescriptorSupplier extends TagKeysBaseDescriptorSupplier { + TagKeysFileDescriptorSupplier() {} + } + + private static final class TagKeysMethodDescriptorSupplier extends TagKeysBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + TagKeysMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (TagKeysGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new TagKeysFileDescriptorSupplier()) + .addMethod(getListTagKeysMethod()) + .addMethod(getGetTagKeyMethod()) + .addMethod(getCreateTagKeyMethod()) + .addMethod(getUpdateTagKeyMethod()) + .addMethod(getDeleteTagKeyMethod()) + .addMethod(getGetIamPolicyMethod()) + .addMethod(getSetIamPolicyMethod()) + .addMethod(getTestIamPermissionsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-resourcemanager/grpc-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagValuesGrpc.java b/java-resourcemanager/grpc-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagValuesGrpc.java new file mode 100644 index 000000000000..3bb83214a6a1 --- /dev/null +++ b/java-resourcemanager/grpc-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagValuesGrpc.java @@ -0,0 +1,1220 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.resourcemanager.v3; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Allow users to create and manage tag values.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/resourcemanager/v3/tag_values.proto") +public final class TagValuesGrpc { + + private TagValuesGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.resourcemanager.v3.TagValues"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.ListTagValuesRequest, + com.google.cloud.resourcemanager.v3.ListTagValuesResponse> + getListTagValuesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListTagValues", + requestType = com.google.cloud.resourcemanager.v3.ListTagValuesRequest.class, + responseType = com.google.cloud.resourcemanager.v3.ListTagValuesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.ListTagValuesRequest, + com.google.cloud.resourcemanager.v3.ListTagValuesResponse> + getListTagValuesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.ListTagValuesRequest, + com.google.cloud.resourcemanager.v3.ListTagValuesResponse> + getListTagValuesMethod; + if ((getListTagValuesMethod = TagValuesGrpc.getListTagValuesMethod) == null) { + synchronized (TagValuesGrpc.class) { + if ((getListTagValuesMethod = TagValuesGrpc.getListTagValuesMethod) == null) { + TagValuesGrpc.getListTagValuesMethod = + getListTagValuesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListTagValues")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.ListTagValuesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.ListTagValuesResponse + .getDefaultInstance())) + .setSchemaDescriptor(new TagValuesMethodDescriptorSupplier("ListTagValues")) + .build(); + } + } + } + return getListTagValuesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.GetTagValueRequest, + com.google.cloud.resourcemanager.v3.TagValue> + getGetTagValueMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetTagValue", + requestType = com.google.cloud.resourcemanager.v3.GetTagValueRequest.class, + responseType = com.google.cloud.resourcemanager.v3.TagValue.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.GetTagValueRequest, + com.google.cloud.resourcemanager.v3.TagValue> + getGetTagValueMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.GetTagValueRequest, + com.google.cloud.resourcemanager.v3.TagValue> + getGetTagValueMethod; + if ((getGetTagValueMethod = TagValuesGrpc.getGetTagValueMethod) == null) { + synchronized (TagValuesGrpc.class) { + if ((getGetTagValueMethod = TagValuesGrpc.getGetTagValueMethod) == null) { + TagValuesGrpc.getGetTagValueMethod = + getGetTagValueMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetTagValue")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.GetTagValueRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.TagValue.getDefaultInstance())) + .setSchemaDescriptor(new TagValuesMethodDescriptorSupplier("GetTagValue")) + .build(); + } + } + } + return getGetTagValueMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.CreateTagValueRequest, + com.google.longrunning.Operation> + getCreateTagValueMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateTagValue", + requestType = com.google.cloud.resourcemanager.v3.CreateTagValueRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.CreateTagValueRequest, + com.google.longrunning.Operation> + getCreateTagValueMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.CreateTagValueRequest, + com.google.longrunning.Operation> + getCreateTagValueMethod; + if ((getCreateTagValueMethod = TagValuesGrpc.getCreateTagValueMethod) == null) { + synchronized (TagValuesGrpc.class) { + if ((getCreateTagValueMethod = TagValuesGrpc.getCreateTagValueMethod) == null) { + TagValuesGrpc.getCreateTagValueMethod = + getCreateTagValueMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateTagValue")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.CreateTagValueRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new TagValuesMethodDescriptorSupplier("CreateTagValue")) + .build(); + } + } + } + return getCreateTagValueMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.UpdateTagValueRequest, + com.google.longrunning.Operation> + getUpdateTagValueMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateTagValue", + requestType = com.google.cloud.resourcemanager.v3.UpdateTagValueRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.UpdateTagValueRequest, + com.google.longrunning.Operation> + getUpdateTagValueMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.UpdateTagValueRequest, + com.google.longrunning.Operation> + getUpdateTagValueMethod; + if ((getUpdateTagValueMethod = TagValuesGrpc.getUpdateTagValueMethod) == null) { + synchronized (TagValuesGrpc.class) { + if ((getUpdateTagValueMethod = TagValuesGrpc.getUpdateTagValueMethod) == null) { + TagValuesGrpc.getUpdateTagValueMethod = + getUpdateTagValueMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateTagValue")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.UpdateTagValueRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new TagValuesMethodDescriptorSupplier("UpdateTagValue")) + .build(); + } + } + } + return getUpdateTagValueMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.DeleteTagValueRequest, + com.google.longrunning.Operation> + getDeleteTagValueMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteTagValue", + requestType = com.google.cloud.resourcemanager.v3.DeleteTagValueRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.DeleteTagValueRequest, + com.google.longrunning.Operation> + getDeleteTagValueMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.resourcemanager.v3.DeleteTagValueRequest, + com.google.longrunning.Operation> + getDeleteTagValueMethod; + if ((getDeleteTagValueMethod = TagValuesGrpc.getDeleteTagValueMethod) == null) { + synchronized (TagValuesGrpc.class) { + if ((getDeleteTagValueMethod = TagValuesGrpc.getDeleteTagValueMethod) == null) { + TagValuesGrpc.getDeleteTagValueMethod = + getDeleteTagValueMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteTagValue")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.resourcemanager.v3.DeleteTagValueRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new TagValuesMethodDescriptorSupplier("DeleteTagValue")) + .build(); + } + } + } + return getDeleteTagValueMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetIamPolicy", + requestType = com.google.iam.v1.GetIamPolicyRequest.class, + responseType = com.google.iam.v1.Policy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod() { + io.grpc.MethodDescriptor + getGetIamPolicyMethod; + if ((getGetIamPolicyMethod = TagValuesGrpc.getGetIamPolicyMethod) == null) { + synchronized (TagValuesGrpc.class) { + if ((getGetIamPolicyMethod = TagValuesGrpc.getGetIamPolicyMethod) == null) { + TagValuesGrpc.getGetIamPolicyMethod = + getGetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor(new TagValuesMethodDescriptorSupplier("GetIamPolicy")) + .build(); + } + } + } + return getGetIamPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetIamPolicy", + requestType = com.google.iam.v1.SetIamPolicyRequest.class, + responseType = com.google.iam.v1.Policy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod() { + io.grpc.MethodDescriptor + getSetIamPolicyMethod; + if ((getSetIamPolicyMethod = TagValuesGrpc.getSetIamPolicyMethod) == null) { + synchronized (TagValuesGrpc.class) { + if ((getSetIamPolicyMethod = TagValuesGrpc.getSetIamPolicyMethod) == null) { + TagValuesGrpc.getSetIamPolicyMethod = + getSetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor(new TagValuesMethodDescriptorSupplier("SetIamPolicy")) + .build(); + } + } + } + return getSetIamPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "TestIamPermissions", + requestType = com.google.iam.v1.TestIamPermissionsRequest.class, + responseType = com.google.iam.v1.TestIamPermissionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + if ((getTestIamPermissionsMethod = TagValuesGrpc.getTestIamPermissionsMethod) == null) { + synchronized (TagValuesGrpc.class) { + if ((getTestIamPermissionsMethod = TagValuesGrpc.getTestIamPermissionsMethod) == null) { + TagValuesGrpc.getTestIamPermissionsMethod = + getTestIamPermissionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "TestIamPermissions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new TagValuesMethodDescriptorSupplier("TestIamPermissions")) + .build(); + } + } + } + return getTestIamPermissionsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static TagValuesStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TagValuesStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TagValuesStub(channel, callOptions); + } + }; + return TagValuesStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static TagValuesBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TagValuesBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TagValuesBlockingStub(channel, callOptions); + } + }; + return TagValuesBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static TagValuesFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TagValuesFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TagValuesFutureStub(channel, callOptions); + } + }; + return TagValuesFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Allow users to create and manage tag values.
+   * 
+ */ + public abstract static class TagValuesImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists all TagValues for a specific TagKey.
+     * 
+ */ + public void listTagValues( + com.google.cloud.resourcemanager.v3.ListTagValuesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListTagValuesMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves TagValue. If the TagValue or namespaced name does not exist, or
+     * if the user does not have permission to view it, this method will return
+     * `PERMISSION_DENIED`.
+     * 
+ */ + public void getTagValue( + com.google.cloud.resourcemanager.v3.GetTagValueRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetTagValueMethod(), responseObserver); + } + + /** + * + * + *
+     * 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 300
+     * TagValues can exist under a TagKey at any given time.
+     * 
+ */ + public void createTagValue( + com.google.cloud.resourcemanager.v3.CreateTagValueRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateTagValueMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the attributes of the TagValue resource.
+     * 
+ */ + public void updateTagValue( + com.google.cloud.resourcemanager.v3.UpdateTagValueRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateTagValueMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a TagValue. The TagValue cannot have any bindings when it is
+     * deleted.
+     * 
+ */ + public void deleteTagValue( + com.google.cloud.resourcemanager.v3.DeleteTagValueRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteTagValueMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetIamPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSetIamPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getTestIamPermissionsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListTagValuesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.ListTagValuesRequest, + com.google.cloud.resourcemanager.v3.ListTagValuesResponse>( + this, METHODID_LIST_TAG_VALUES))) + .addMethod( + getGetTagValueMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.GetTagValueRequest, + com.google.cloud.resourcemanager.v3.TagValue>(this, METHODID_GET_TAG_VALUE))) + .addMethod( + getCreateTagValueMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.CreateTagValueRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_TAG_VALUE))) + .addMethod( + getUpdateTagValueMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.UpdateTagValueRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_TAG_VALUE))) + .addMethod( + getDeleteTagValueMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.resourcemanager.v3.DeleteTagValueRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_TAG_VALUE))) + .addMethod( + getGetIamPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_GET_IAM_POLICY))) + .addMethod( + getSetIamPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_SET_IAM_POLICY))) + .addMethod( + getTestIamPermissionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse>( + this, METHODID_TEST_IAM_PERMISSIONS))) + .build(); + } + } + + /** + * + * + *
+   * Allow users to create and manage tag values.
+   * 
+ */ + public static final class TagValuesStub extends io.grpc.stub.AbstractAsyncStub { + private TagValuesStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TagValuesStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TagValuesStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all TagValues for a specific TagKey.
+     * 
+ */ + public void listTagValues( + com.google.cloud.resourcemanager.v3.ListTagValuesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListTagValuesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves TagValue. If the TagValue or namespaced name does not exist, or
+     * if the user does not have permission to view it, this method will return
+     * `PERMISSION_DENIED`.
+     * 
+ */ + public void getTagValue( + com.google.cloud.resourcemanager.v3.GetTagValueRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetTagValueMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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 300
+     * TagValues can exist under a TagKey at any given time.
+     * 
+ */ + public void createTagValue( + com.google.cloud.resourcemanager.v3.CreateTagValueRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateTagValueMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the attributes of the TagValue resource.
+     * 
+ */ + public void updateTagValue( + com.google.cloud.resourcemanager.v3.UpdateTagValueRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateTagValueMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a TagValue. The TagValue cannot have any bindings when it is
+     * deleted.
+     * 
+ */ + public void deleteTagValue( + com.google.cloud.resourcemanager.v3.DeleteTagValueRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteTagValueMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Allow users to create and manage tag values.
+   * 
+ */ + public static final class TagValuesBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private TagValuesBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TagValuesBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TagValuesBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all TagValues for a specific TagKey.
+     * 
+ */ + public com.google.cloud.resourcemanager.v3.ListTagValuesResponse listTagValues( + com.google.cloud.resourcemanager.v3.ListTagValuesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListTagValuesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves TagValue. If the TagValue or namespaced name does not exist, or
+     * if the user does not have permission to view it, this method will return
+     * `PERMISSION_DENIED`.
+     * 
+ */ + public com.google.cloud.resourcemanager.v3.TagValue getTagValue( + com.google.cloud.resourcemanager.v3.GetTagValueRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetTagValueMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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 300
+     * TagValues can exist under a TagKey at any given time.
+     * 
+ */ + public com.google.longrunning.Operation createTagValue( + com.google.cloud.resourcemanager.v3.CreateTagValueRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateTagValueMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the attributes of the TagValue resource.
+     * 
+ */ + public com.google.longrunning.Operation updateTagValue( + com.google.cloud.resourcemanager.v3.UpdateTagValueRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateTagValueMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a TagValue. The TagValue cannot have any bindings when it is
+     * deleted.
+     * 
+ */ + public com.google.longrunning.Operation deleteTagValue( + com.google.cloud.resourcemanager.v3.DeleteTagValueRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteTagValueMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetIamPolicyMethod(), getCallOptions(), 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.
+     * 
+ */ + public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getTestIamPermissionsMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Allow users to create and manage tag values.
+   * 
+ */ + public static final class TagValuesFutureStub + extends io.grpc.stub.AbstractFutureStub { + private TagValuesFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TagValuesFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TagValuesFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all TagValues for a specific TagKey.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.resourcemanager.v3.ListTagValuesResponse> + listTagValues(com.google.cloud.resourcemanager.v3.ListTagValuesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListTagValuesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves TagValue. If the TagValue or namespaced name does not exist, or
+     * if the user does not have permission to view it, this method will return
+     * `PERMISSION_DENIED`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.resourcemanager.v3.TagValue> + getTagValue(com.google.cloud.resourcemanager.v3.GetTagValueRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetTagValueMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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 300
+     * TagValues can exist under a TagKey at any given time.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createTagValue(com.google.cloud.resourcemanager.v3.CreateTagValueRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateTagValueMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the attributes of the TagValue resource.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateTagValue(com.google.cloud.resourcemanager.v3.UpdateTagValueRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateTagValueMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a TagValue. The TagValue cannot have any bindings when it is
+     * deleted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteTagValue(com.google.cloud.resourcemanager.v3.DeleteTagValueRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteTagValueMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v1.TestIamPermissionsResponse> + testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_TAG_VALUES = 0; + private static final int METHODID_GET_TAG_VALUE = 1; + private static final int METHODID_CREATE_TAG_VALUE = 2; + private static final int METHODID_UPDATE_TAG_VALUE = 3; + private static final int METHODID_DELETE_TAG_VALUE = 4; + private static final int METHODID_GET_IAM_POLICY = 5; + private static final int METHODID_SET_IAM_POLICY = 6; + private static final int METHODID_TEST_IAM_PERMISSIONS = 7; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final TagValuesImplBase serviceImpl; + private final int methodId; + + MethodHandlers(TagValuesImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_TAG_VALUES: + serviceImpl.listTagValues( + (com.google.cloud.resourcemanager.v3.ListTagValuesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.resourcemanager.v3.ListTagValuesResponse>) + responseObserver); + break; + case METHODID_GET_TAG_VALUE: + serviceImpl.getTagValue( + (com.google.cloud.resourcemanager.v3.GetTagValueRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_TAG_VALUE: + serviceImpl.createTagValue( + (com.google.cloud.resourcemanager.v3.CreateTagValueRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_TAG_VALUE: + serviceImpl.updateTagValue( + (com.google.cloud.resourcemanager.v3.UpdateTagValueRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_TAG_VALUE: + serviceImpl.deleteTagValue( + (com.google.cloud.resourcemanager.v3.DeleteTagValueRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_IAM_POLICY: + serviceImpl.getIamPolicy( + (com.google.iam.v1.GetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_IAM_POLICY: + serviceImpl.setIamPolicy( + (com.google.iam.v1.SetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_TEST_IAM_PERMISSIONS: + serviceImpl.testIamPermissions( + (com.google.iam.v1.TestIamPermissionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class TagValuesBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + TagValuesBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.resourcemanager.v3.TagValuesProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("TagValues"); + } + } + + private static final class TagValuesFileDescriptorSupplier + extends TagValuesBaseDescriptorSupplier { + TagValuesFileDescriptorSupplier() {} + } + + private static final class TagValuesMethodDescriptorSupplier + extends TagValuesBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + TagValuesMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (TagValuesGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new TagValuesFileDescriptorSupplier()) + .addMethod(getListTagValuesMethod()) + .addMethod(getGetTagValueMethod()) + .addMethod(getCreateTagValueMethod()) + .addMethod(getUpdateTagValueMethod()) + .addMethod(getDeleteTagValueMethod()) + .addMethod(getGetIamPolicyMethod()) + .addMethod(getSetIamPolicyMethod()) + .addMethod(getTestIamPermissionsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-resourcemanager/pom.xml b/java-resourcemanager/pom.xml index b70b5d8332d9..a80eba999a8a 100644 --- a/java-resourcemanager/pom.xml +++ b/java-resourcemanager/pom.xml @@ -63,6 +63,16 @@ 0.118.13-alpha-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-resourcemanager-v3 + 0.118.13-alpha-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-resourcemanager-v3 + 0.118.13-alpha-SNAPSHOT + com.google.cloud google-cloud-shared-dependencies @@ -92,6 +102,8 @@ google-cloud-resourcemanager + grpc-google-cloud-resourcemanager-v3 + proto-google-cloud-resourcemanager-v3 google-cloud-resourcemanager-bom diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/clirr-ignored-differences.xml b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/clirr-ignored-differences.xml new file mode 100644 index 000000000000..9ad7d99c8a0e --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/resourcemanager/v3/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/resourcemanager/v3/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/resourcemanager/v3/*OrBuilder + boolean has*(*) + + diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/pom.xml b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/pom.xml new file mode 100644 index 000000000000..32f9b30ab942 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-resourcemanager-v3 + 0.118.13-alpha-SNAPSHOT + proto-google-cloud-resourcemanager-v3 + Proto library for google-cloud-resourcemanager + + com.google.cloud + google-cloud-resourcemanager-parent + 0.118.13-alpha-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateFolderMetadata.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateFolderMetadata.java new file mode 100644 index 000000000000..0b4d0d546f54 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateFolderMetadata.java @@ -0,0 +1,823 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * Metadata pertaining to the Folder creation process.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.CreateFolderMetadata} + */ +public final class CreateFolderMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.CreateFolderMetadata) + CreateFolderMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateFolderMetadata.newBuilder() to construct. + private CreateFolderMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateFolderMetadata() { + displayName_ = ""; + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateFolderMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateFolderMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_CreateFolderMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_CreateFolderMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.CreateFolderMetadata.class, + com.google.cloud.resourcemanager.v3.CreateFolderMetadata.Builder.class); + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * The display name of the folder.
+   * 
+ * + * string display_name = 1; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * The display name of the folder.
+   * 
+ * + * string display_name = 1; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARENT_FIELD_NUMBER = 2; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * The resource name of the folder or organization we are creating the folder
+   * under.
+   * 
+ * + * string parent = 2; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the folder or organization we are creating the folder
+   * under.
+   * 
+ * + * string parent = 2; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, displayName_); + } + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, parent_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, displayName_); + } + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, parent_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.CreateFolderMetadata)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.CreateFolderMetadata other = + (com.google.cloud.resourcemanager.v3.CreateFolderMetadata) obj; + + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getParent().equals(other.getParent())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.CreateFolderMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Metadata pertaining to the Folder creation process.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.CreateFolderMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.CreateFolderMetadata) + com.google.cloud.resourcemanager.v3.CreateFolderMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_CreateFolderMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_CreateFolderMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.CreateFolderMetadata.class, + com.google.cloud.resourcemanager.v3.CreateFolderMetadata.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.CreateFolderMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + displayName_ = ""; + + parent_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_CreateFolderMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateFolderMetadata getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.CreateFolderMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateFolderMetadata build() { + com.google.cloud.resourcemanager.v3.CreateFolderMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateFolderMetadata buildPartial() { + com.google.cloud.resourcemanager.v3.CreateFolderMetadata result = + new com.google.cloud.resourcemanager.v3.CreateFolderMetadata(this); + result.displayName_ = displayName_; + result.parent_ = parent_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.CreateFolderMetadata) { + return mergeFrom((com.google.cloud.resourcemanager.v3.CreateFolderMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.CreateFolderMetadata other) { + if (other == com.google.cloud.resourcemanager.v3.CreateFolderMetadata.getDefaultInstance()) + return this; + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.CreateFolderMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.CreateFolderMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * The display name of the folder.
+     * 
+ * + * string display_name = 1; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The display name of the folder.
+     * 
+ * + * string display_name = 1; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The display name of the folder.
+     * 
+ * + * string display_name = 1; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The display name of the folder.
+     * 
+ * + * string display_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The display name of the folder.
+     * 
+ * + * string display_name = 1; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * The resource name of the folder or organization we are creating the folder
+     * under.
+     * 
+ * + * string parent = 2; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the folder or organization we are creating the folder
+     * under.
+     * 
+ * + * string parent = 2; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the folder or organization we are creating the folder
+     * under.
+     * 
+ * + * string parent = 2; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the folder or organization we are creating the folder
+     * under.
+     * 
+ * + * string parent = 2; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the folder or organization we are creating the folder
+     * under.
+     * 
+ * + * string parent = 2; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.CreateFolderMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.CreateFolderMetadata) + private static final com.google.cloud.resourcemanager.v3.CreateFolderMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.CreateFolderMetadata(); + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateFolderMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateFolderMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateFolderMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateFolderMetadataOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateFolderMetadataOrBuilder.java new file mode 100644 index 000000000000..65b14a0ec1e5 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateFolderMetadataOrBuilder.java @@ -0,0 +1,77 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +public interface CreateFolderMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.CreateFolderMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The display name of the folder.
+   * 
+ * + * string display_name = 1; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * The display name of the folder.
+   * 
+ * + * string display_name = 1; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * The resource name of the folder or organization we are creating the folder
+   * under.
+   * 
+ * + * string parent = 2; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * The resource name of the folder or organization we are creating the folder
+   * under.
+   * 
+ * + * string parent = 2; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateFolderRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateFolderRequest.java new file mode 100644 index 000000000000..86f5ce04fd8a --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateFolderRequest.java @@ -0,0 +1,770 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The CreateFolder request message.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.CreateFolderRequest} + */ +public final class CreateFolderRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.CreateFolderRequest) + CreateFolderRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateFolderRequest.newBuilder() to construct. + private CreateFolderRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateFolderRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateFolderRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateFolderRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + com.google.cloud.resourcemanager.v3.Folder.Builder subBuilder = null; + if (folder_ != null) { + subBuilder = folder_.toBuilder(); + } + folder_ = + input.readMessage( + com.google.cloud.resourcemanager.v3.Folder.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(folder_); + folder_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_CreateFolderRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_CreateFolderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.CreateFolderRequest.class, + com.google.cloud.resourcemanager.v3.CreateFolderRequest.Builder.class); + } + + public static final int FOLDER_FIELD_NUMBER = 2; + private com.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.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the folder field is set. + */ + @java.lang.Override + public boolean hasFolder() { + return folder_ != null; + } + /** + * + * + *
+   * Required. The folder being created, only the display name and parent will be
+   * consulted. All other fields will be ignored.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The folder. + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Folder getFolder() { + return folder_ == null + ? com.google.cloud.resourcemanager.v3.Folder.getDefaultInstance() + : folder_; + } + /** + * + * + *
+   * Required. The folder being created, only the display name and parent will be
+   * consulted. All other fields will be ignored.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.FolderOrBuilder getFolderOrBuilder() { + return getFolder(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (folder_ != null) { + output.writeMessage(2, getFolder()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (folder_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getFolder()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.CreateFolderRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.CreateFolderRequest other = + (com.google.cloud.resourcemanager.v3.CreateFolderRequest) obj; + + if (hasFolder() != other.hasFolder()) return false; + if (hasFolder()) { + if (!getFolder().equals(other.getFolder())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasFolder()) { + hash = (37 * hash) + FOLDER_FIELD_NUMBER; + hash = (53 * hash) + getFolder().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.CreateFolderRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The CreateFolder request message.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.CreateFolderRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.CreateFolderRequest) + com.google.cloud.resourcemanager.v3.CreateFolderRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_CreateFolderRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_CreateFolderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.CreateFolderRequest.class, + com.google.cloud.resourcemanager.v3.CreateFolderRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.CreateFolderRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (folderBuilder_ == null) { + folder_ = null; + } else { + folder_ = null; + folderBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_CreateFolderRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateFolderRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.CreateFolderRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateFolderRequest build() { + com.google.cloud.resourcemanager.v3.CreateFolderRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateFolderRequest buildPartial() { + com.google.cloud.resourcemanager.v3.CreateFolderRequest result = + new com.google.cloud.resourcemanager.v3.CreateFolderRequest(this); + if (folderBuilder_ == null) { + result.folder_ = folder_; + } else { + result.folder_ = folderBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.CreateFolderRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.CreateFolderRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.CreateFolderRequest other) { + if (other == com.google.cloud.resourcemanager.v3.CreateFolderRequest.getDefaultInstance()) + return this; + if (other.hasFolder()) { + mergeFolder(other.getFolder()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.CreateFolderRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.CreateFolderRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.resourcemanager.v3.Folder folder_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Folder, + com.google.cloud.resourcemanager.v3.Folder.Builder, + com.google.cloud.resourcemanager.v3.FolderOrBuilder> + folderBuilder_; + /** + * + * + *
+     * Required. The folder being created, only the display name and parent will be
+     * consulted. All other fields will be ignored.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the folder field is set. + */ + public boolean hasFolder() { + return folderBuilder_ != null || folder_ != null; + } + /** + * + * + *
+     * Required. The folder being created, only the display name and parent will be
+     * consulted. All other fields will be ignored.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The folder. + */ + public com.google.cloud.resourcemanager.v3.Folder getFolder() { + if (folderBuilder_ == null) { + return folder_ == null + ? com.google.cloud.resourcemanager.v3.Folder.getDefaultInstance() + : folder_; + } else { + return folderBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The folder being created, only the display name and parent will be
+     * consulted. All other fields will be ignored.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFolder(com.google.cloud.resourcemanager.v3.Folder value) { + if (folderBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + folder_ = value; + onChanged(); + } else { + folderBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The folder being created, only the display name and parent will be
+     * consulted. All other fields will be ignored.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFolder(com.google.cloud.resourcemanager.v3.Folder.Builder builderForValue) { + if (folderBuilder_ == null) { + folder_ = builderForValue.build(); + onChanged(); + } else { + folderBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The folder being created, only the display name and parent will be
+     * consulted. All other fields will be ignored.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeFolder(com.google.cloud.resourcemanager.v3.Folder value) { + if (folderBuilder_ == null) { + if (folder_ != null) { + folder_ = + com.google.cloud.resourcemanager.v3.Folder.newBuilder(folder_) + .mergeFrom(value) + .buildPartial(); + } else { + folder_ = value; + } + onChanged(); + } else { + folderBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The folder being created, only the display name and parent will be
+     * consulted. All other fields will be ignored.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearFolder() { + if (folderBuilder_ == null) { + folder_ = null; + onChanged(); + } else { + folder_ = null; + folderBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The folder being created, only the display name and parent will be
+     * consulted. All other fields will be ignored.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.resourcemanager.v3.Folder.Builder getFolderBuilder() { + + onChanged(); + return getFolderFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The folder being created, only the display name and parent will be
+     * consulted. All other fields will be ignored.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.resourcemanager.v3.FolderOrBuilder getFolderOrBuilder() { + if (folderBuilder_ != null) { + return folderBuilder_.getMessageOrBuilder(); + } else { + return folder_ == null + ? com.google.cloud.resourcemanager.v3.Folder.getDefaultInstance() + : folder_; + } + } + /** + * + * + *
+     * Required. The folder being created, only the display name and parent will be
+     * consulted. All other fields will be ignored.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Folder, + com.google.cloud.resourcemanager.v3.Folder.Builder, + com.google.cloud.resourcemanager.v3.FolderOrBuilder> + getFolderFieldBuilder() { + if (folderBuilder_ == null) { + folderBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Folder, + com.google.cloud.resourcemanager.v3.Folder.Builder, + com.google.cloud.resourcemanager.v3.FolderOrBuilder>( + getFolder(), getParentForChildren(), isClean()); + folder_ = null; + } + return folderBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.CreateFolderRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.CreateFolderRequest) + private static final com.google.cloud.resourcemanager.v3.CreateFolderRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.CreateFolderRequest(); + } + + public static com.google.cloud.resourcemanager.v3.CreateFolderRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateFolderRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateFolderRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateFolderRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateFolderRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateFolderRequestOrBuilder.java new file mode 100644 index 000000000000..44b17d947a7a --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateFolderRequestOrBuilder.java @@ -0,0 +1,69 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +public interface CreateFolderRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.CreateFolderRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The folder being created, only the display name and parent will be
+   * consulted. All other fields will be ignored.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the folder field is set. + */ + boolean hasFolder(); + /** + * + * + *
+   * Required. The folder being created, only the display name and parent will be
+   * consulted. All other fields will be ignored.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The folder. + */ + com.google.cloud.resourcemanager.v3.Folder getFolder(); + /** + * + * + *
+   * Required. The folder being created, only the display name and parent will be
+   * consulted. All other fields will be ignored.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.resourcemanager.v3.FolderOrBuilder getFolderOrBuilder(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateProjectMetadata.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateProjectMetadata.java new file mode 100644 index 000000000000..98cebfcda469 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateProjectMetadata.java @@ -0,0 +1,921 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * A status object which is used as the `metadata` field for the Operation
+ * returned by CreateProject. It provides insight for when significant phases of
+ * Project creation have completed.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.CreateProjectMetadata} + */ +public final class CreateProjectMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.CreateProjectMetadata) + CreateProjectMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateProjectMetadata.newBuilder() to construct. + private CreateProjectMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateProjectMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateProjectMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateProjectMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 16: + { + gettable_ = input.readBool(); + break; + } + case 24: + { + ready_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_CreateProjectMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_CreateProjectMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.CreateProjectMetadata.class, + com.google.cloud.resourcemanager.v3.CreateProjectMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Creation time of the project creation workflow.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Creation time of the project creation workflow.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Creation time of the project creation workflow.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int GETTABLE_FIELD_NUMBER = 2; + private boolean 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.
+   * 
+ * + * bool gettable = 2; + * + * @return The gettable. + */ + @java.lang.Override + public boolean getGettable() { + return gettable_; + } + + public static final int READY_FIELD_NUMBER = 3; + private boolean ready_; + /** + * + * + *
+   * True if the project creation process is complete.
+   * 
+ * + * bool ready = 3; + * + * @return The ready. + */ + @java.lang.Override + public boolean getReady() { + return ready_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (gettable_ != false) { + output.writeBool(2, gettable_); + } + if (ready_ != false) { + output.writeBool(3, ready_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (gettable_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, gettable_); + } + if (ready_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, ready_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.CreateProjectMetadata)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.CreateProjectMetadata other = + (com.google.cloud.resourcemanager.v3.CreateProjectMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (getGettable() != other.getGettable()) return false; + if (getReady() != other.getReady()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + GETTABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getGettable()); + hash = (37 * hash) + READY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReady()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.CreateProjectMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A status object which is used as the `metadata` field for the Operation
+   * returned by CreateProject. It provides insight for when significant phases of
+   * Project creation have completed.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.CreateProjectMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.CreateProjectMetadata) + com.google.cloud.resourcemanager.v3.CreateProjectMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_CreateProjectMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_CreateProjectMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.CreateProjectMetadata.class, + com.google.cloud.resourcemanager.v3.CreateProjectMetadata.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.CreateProjectMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + gettable_ = false; + + ready_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_CreateProjectMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateProjectMetadata getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.CreateProjectMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateProjectMetadata build() { + com.google.cloud.resourcemanager.v3.CreateProjectMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateProjectMetadata buildPartial() { + com.google.cloud.resourcemanager.v3.CreateProjectMetadata result = + new com.google.cloud.resourcemanager.v3.CreateProjectMetadata(this); + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.gettable_ = gettable_; + result.ready_ = ready_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.CreateProjectMetadata) { + return mergeFrom((com.google.cloud.resourcemanager.v3.CreateProjectMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.CreateProjectMetadata other) { + if (other == com.google.cloud.resourcemanager.v3.CreateProjectMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.getGettable() != false) { + setGettable(other.getGettable()); + } + if (other.getReady() != false) { + setReady(other.getReady()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.CreateProjectMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.CreateProjectMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Creation time of the project creation workflow.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Creation time of the project creation workflow.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Creation time of the project creation workflow.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Creation time of the project creation workflow.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Creation time of the project creation workflow.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Creation time of the project creation workflow.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Creation time of the project creation workflow.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Creation time of the project creation workflow.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Creation time of the project creation workflow.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private boolean 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.
+     * 
+ * + * bool gettable = 2; + * + * @return The gettable. + */ + @java.lang.Override + public boolean getGettable() { + return 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.
+     * 
+ * + * bool gettable = 2; + * + * @param value The gettable to set. + * @return This builder for chaining. + */ + public Builder setGettable(boolean value) { + + gettable_ = value; + onChanged(); + 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.
+     * 
+ * + * bool gettable = 2; + * + * @return This builder for chaining. + */ + public Builder clearGettable() { + + gettable_ = false; + onChanged(); + return this; + } + + private boolean ready_; + /** + * + * + *
+     * True if the project creation process is complete.
+     * 
+ * + * bool ready = 3; + * + * @return The ready. + */ + @java.lang.Override + public boolean getReady() { + return ready_; + } + /** + * + * + *
+     * True if the project creation process is complete.
+     * 
+ * + * bool ready = 3; + * + * @param value The ready to set. + * @return This builder for chaining. + */ + public Builder setReady(boolean value) { + + ready_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * True if the project creation process is complete.
+     * 
+ * + * bool ready = 3; + * + * @return This builder for chaining. + */ + public Builder clearReady() { + + ready_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.CreateProjectMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.CreateProjectMetadata) + private static final com.google.cloud.resourcemanager.v3.CreateProjectMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.CreateProjectMetadata(); + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateProjectMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateProjectMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateProjectMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateProjectMetadataOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateProjectMetadataOrBuilder.java new file mode 100644 index 000000000000..74843d8ae71a --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateProjectMetadataOrBuilder.java @@ -0,0 +1,88 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +public interface CreateProjectMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.CreateProjectMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Creation time of the project creation workflow.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Creation time of the project creation workflow.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Creation time of the project creation workflow.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * bool gettable = 2; + * + * @return The gettable. + */ + boolean getGettable(); + + /** + * + * + *
+   * True if the project creation process is complete.
+   * 
+ * + * bool ready = 3; + * + * @return The ready. + */ + boolean getReady(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateProjectRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateProjectRequest.java new file mode 100644 index 000000000000..35fd08ad9d1b --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateProjectRequest.java @@ -0,0 +1,834 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The request sent to the
+ * [CreateProject][google.cloud.resourcemanager.v3.Projects.CreateProject]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.CreateProjectRequest} + */ +public final class CreateProjectRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.CreateProjectRequest) + CreateProjectRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateProjectRequest.newBuilder() to construct. + private CreateProjectRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateProjectRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateProjectRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateProjectRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.resourcemanager.v3.Project.Builder subBuilder = null; + if (project_ != null) { + subBuilder = project_.toBuilder(); + } + project_ = + input.readMessage( + com.google.cloud.resourcemanager.v3.Project.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(project_); + project_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_CreateProjectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_CreateProjectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.CreateProjectRequest.class, + com.google.cloud.resourcemanager.v3.CreateProjectRequest.Builder.class); + } + + public static final int PROJECT_FIELD_NUMBER = 1; + private com.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 Organziation, the parent
+   * will be set to that Organization.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the project field is set. + */ + @java.lang.Override + public boolean hasProject() { + return project_ != null; + } + /** + * + * + *
+   * 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 Organziation, the parent
+   * will be set to that Organization.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The project. + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Project getProject() { + return project_ == null + ? com.google.cloud.resourcemanager.v3.Project.getDefaultInstance() + : 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 Organziation, the parent
+   * will be set to that Organization.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ProjectOrBuilder getProjectOrBuilder() { + return getProject(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (project_ != null) { + output.writeMessage(1, getProject()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (project_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getProject()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.CreateProjectRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.CreateProjectRequest other = + (com.google.cloud.resourcemanager.v3.CreateProjectRequest) obj; + + if (hasProject() != other.hasProject()) return false; + if (hasProject()) { + if (!getProject().equals(other.getProject())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasProject()) { + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.CreateProjectRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request sent to the
+   * [CreateProject][google.cloud.resourcemanager.v3.Projects.CreateProject]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.CreateProjectRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.CreateProjectRequest) + com.google.cloud.resourcemanager.v3.CreateProjectRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_CreateProjectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_CreateProjectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.CreateProjectRequest.class, + com.google.cloud.resourcemanager.v3.CreateProjectRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.CreateProjectRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (projectBuilder_ == null) { + project_ = null; + } else { + project_ = null; + projectBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_CreateProjectRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateProjectRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.CreateProjectRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateProjectRequest build() { + com.google.cloud.resourcemanager.v3.CreateProjectRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateProjectRequest buildPartial() { + com.google.cloud.resourcemanager.v3.CreateProjectRequest result = + new com.google.cloud.resourcemanager.v3.CreateProjectRequest(this); + if (projectBuilder_ == null) { + result.project_ = project_; + } else { + result.project_ = projectBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.CreateProjectRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.CreateProjectRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.CreateProjectRequest other) { + if (other == com.google.cloud.resourcemanager.v3.CreateProjectRequest.getDefaultInstance()) + return this; + if (other.hasProject()) { + mergeProject(other.getProject()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.CreateProjectRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.CreateProjectRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.resourcemanager.v3.Project project_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Project, + com.google.cloud.resourcemanager.v3.Project.Builder, + com.google.cloud.resourcemanager.v3.ProjectOrBuilder> + projectBuilder_; + /** + * + * + *
+     * 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 Organziation, the parent
+     * will be set to that Organization.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the project field is set. + */ + public boolean hasProject() { + return projectBuilder_ != null || project_ != null; + } + /** + * + * + *
+     * 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 Organziation, the parent
+     * will be set to that Organization.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The project. + */ + public com.google.cloud.resourcemanager.v3.Project getProject() { + if (projectBuilder_ == null) { + return project_ == null + ? com.google.cloud.resourcemanager.v3.Project.getDefaultInstance() + : project_; + } else { + return projectBuilder_.getMessage(); + } + } + /** + * + * + *
+     * 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 Organziation, the parent
+     * will be set to that Organization.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProject(com.google.cloud.resourcemanager.v3.Project value) { + if (projectBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + onChanged(); + } else { + projectBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * 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 Organziation, the parent
+     * will be set to that Organization.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProject(com.google.cloud.resourcemanager.v3.Project.Builder builderForValue) { + if (projectBuilder_ == null) { + project_ = builderForValue.build(); + onChanged(); + } else { + projectBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * 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 Organziation, the parent
+     * will be set to that Organization.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeProject(com.google.cloud.resourcemanager.v3.Project value) { + if (projectBuilder_ == null) { + if (project_ != null) { + project_ = + com.google.cloud.resourcemanager.v3.Project.newBuilder(project_) + .mergeFrom(value) + .buildPartial(); + } else { + project_ = value; + } + onChanged(); + } else { + projectBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * 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 Organziation, the parent
+     * will be set to that Organization.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearProject() { + if (projectBuilder_ == null) { + project_ = null; + onChanged(); + } else { + project_ = null; + projectBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * 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 Organziation, the parent
+     * will be set to that Organization.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.resourcemanager.v3.Project.Builder getProjectBuilder() { + + onChanged(); + return getProjectFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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 Organziation, the parent
+     * will be set to that Organization.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.resourcemanager.v3.ProjectOrBuilder getProjectOrBuilder() { + if (projectBuilder_ != null) { + return projectBuilder_.getMessageOrBuilder(); + } else { + return project_ == null + ? com.google.cloud.resourcemanager.v3.Project.getDefaultInstance() + : 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 Organziation, the parent
+     * will be set to that Organization.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Project, + com.google.cloud.resourcemanager.v3.Project.Builder, + com.google.cloud.resourcemanager.v3.ProjectOrBuilder> + getProjectFieldBuilder() { + if (projectBuilder_ == null) { + projectBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Project, + com.google.cloud.resourcemanager.v3.Project.Builder, + com.google.cloud.resourcemanager.v3.ProjectOrBuilder>( + getProject(), getParentForChildren(), isClean()); + project_ = null; + } + return projectBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.CreateProjectRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.CreateProjectRequest) + private static final com.google.cloud.resourcemanager.v3.CreateProjectRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.CreateProjectRequest(); + } + + public static com.google.cloud.resourcemanager.v3.CreateProjectRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateProjectRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateProjectRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateProjectRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateProjectRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateProjectRequestOrBuilder.java new file mode 100644 index 000000000000..1ab91a73145b --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateProjectRequestOrBuilder.java @@ -0,0 +1,84 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +public interface CreateProjectRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.CreateProjectRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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 Organziation, the parent
+   * will be set to that Organization.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the project field is set. + */ + boolean hasProject(); + /** + * + * + *
+   * 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 Organziation, the parent
+   * will be set to that Organization.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The project. + */ + com.google.cloud.resourcemanager.v3.Project getProject(); + /** + * + * + *
+   * 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 Organziation, the parent
+   * will be set to that Organization.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.resourcemanager.v3.ProjectOrBuilder getProjectOrBuilder(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagBindingMetadata.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagBindingMetadata.java new file mode 100644 index 000000000000..7f34df08c0a8 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagBindingMetadata.java @@ -0,0 +1,460 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_bindings.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * Runtime operation information for creating a TagValue.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.CreateTagBindingMetadata} + */ +public final class CreateTagBindingMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.CreateTagBindingMetadata) + CreateTagBindingMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateTagBindingMetadata.newBuilder() to construct. + private CreateTagBindingMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateTagBindingMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateTagBindingMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateTagBindingMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagBindingMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagBindingMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata.class, + com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata other = + (com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Runtime operation information for creating a TagValue.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.CreateTagBindingMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.CreateTagBindingMetadata) + com.google.cloud.resourcemanager.v3.CreateTagBindingMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagBindingMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagBindingMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata.class, + com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagBindingMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata + getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata build() { + com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata buildPartial() { + com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata result = + new com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata) { + return mergeFrom((com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata other) { + if (other + == com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.CreateTagBindingMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.CreateTagBindingMetadata) + private static final com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata(); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateTagBindingMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateTagBindingMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateTagBindingMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagBindingMetadataOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagBindingMetadataOrBuilder.java new file mode 100644 index 000000000000..5817f158eb1e --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagBindingMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_bindings.proto + +package com.google.cloud.resourcemanager.v3; + +public interface CreateTagBindingMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.CreateTagBindingMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagBindingRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagBindingRequest.java new file mode 100644 index 000000000000..bb564862bc8e --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagBindingRequest.java @@ -0,0 +1,853 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_bindings.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The request message to create a TagBinding.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.CreateTagBindingRequest} + */ +public final class CreateTagBindingRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.CreateTagBindingRequest) + CreateTagBindingRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateTagBindingRequest.newBuilder() to construct. + private CreateTagBindingRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateTagBindingRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateTagBindingRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateTagBindingRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.resourcemanager.v3.TagBinding.Builder subBuilder = null; + if (tagBinding_ != null) { + subBuilder = tagBinding_.toBuilder(); + } + tagBinding_ = + input.readMessage( + com.google.cloud.resourcemanager.v3.TagBinding.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(tagBinding_); + tagBinding_ = subBuilder.buildPartial(); + } + + break; + } + case 16: + { + validateOnly_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagBindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagBindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.CreateTagBindingRequest.class, + com.google.cloud.resourcemanager.v3.CreateTagBindingRequest.Builder.class); + } + + public static final int TAG_BINDING_FIELD_NUMBER = 1; + private com.google.cloud.resourcemanager.v3.TagBinding tagBinding_; + /** + * + * + *
+   * Required. The TagBinding to be created.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the tagBinding field is set. + */ + @java.lang.Override + public boolean hasTagBinding() { + return tagBinding_ != null; + } + /** + * + * + *
+   * Required. The TagBinding to be created.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The tagBinding. + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagBinding getTagBinding() { + return tagBinding_ == null + ? com.google.cloud.resourcemanager.v3.TagBinding.getDefaultInstance() + : tagBinding_; + } + /** + * + * + *
+   * Required. The TagBinding to be created.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagBindingOrBuilder getTagBindingOrBuilder() { + return getTagBinding(); + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 2; + private boolean validateOnly_; + /** + * + * + *
+   * Optional. Set to true to perform the validations necessary for creating the resource,
+   * but not actually perform the action.
+   * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (tagBinding_ != null) { + output.writeMessage(1, getTagBinding()); + } + if (validateOnly_ != false) { + output.writeBool(2, validateOnly_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (tagBinding_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getTagBinding()); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, validateOnly_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.CreateTagBindingRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.CreateTagBindingRequest other = + (com.google.cloud.resourcemanager.v3.CreateTagBindingRequest) obj; + + if (hasTagBinding() != other.hasTagBinding()) return false; + if (hasTagBinding()) { + if (!getTagBinding().equals(other.getTagBinding())) return false; + } + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasTagBinding()) { + hash = (37 * hash) + TAG_BINDING_FIELD_NUMBER; + hash = (53 * hash) + getTagBinding().hashCode(); + } + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.CreateTagBindingRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message to create a TagBinding.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.CreateTagBindingRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.CreateTagBindingRequest) + com.google.cloud.resourcemanager.v3.CreateTagBindingRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagBindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagBindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.CreateTagBindingRequest.class, + com.google.cloud.resourcemanager.v3.CreateTagBindingRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.CreateTagBindingRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (tagBindingBuilder_ == null) { + tagBinding_ = null; + } else { + tagBinding_ = null; + tagBindingBuilder_ = null; + } + validateOnly_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagBindingRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateTagBindingRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.CreateTagBindingRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateTagBindingRequest build() { + com.google.cloud.resourcemanager.v3.CreateTagBindingRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateTagBindingRequest buildPartial() { + com.google.cloud.resourcemanager.v3.CreateTagBindingRequest result = + new com.google.cloud.resourcemanager.v3.CreateTagBindingRequest(this); + if (tagBindingBuilder_ == null) { + result.tagBinding_ = tagBinding_; + } else { + result.tagBinding_ = tagBindingBuilder_.build(); + } + result.validateOnly_ = validateOnly_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.CreateTagBindingRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.CreateTagBindingRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.CreateTagBindingRequest other) { + if (other == com.google.cloud.resourcemanager.v3.CreateTagBindingRequest.getDefaultInstance()) + return this; + if (other.hasTagBinding()) { + mergeTagBinding(other.getTagBinding()); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.CreateTagBindingRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.CreateTagBindingRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.resourcemanager.v3.TagBinding tagBinding_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.TagBinding, + com.google.cloud.resourcemanager.v3.TagBinding.Builder, + com.google.cloud.resourcemanager.v3.TagBindingOrBuilder> + tagBindingBuilder_; + /** + * + * + *
+     * Required. The TagBinding to be created.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the tagBinding field is set. + */ + public boolean hasTagBinding() { + return tagBindingBuilder_ != null || tagBinding_ != null; + } + /** + * + * + *
+     * Required. The TagBinding to be created.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The tagBinding. + */ + public com.google.cloud.resourcemanager.v3.TagBinding getTagBinding() { + if (tagBindingBuilder_ == null) { + return tagBinding_ == null + ? com.google.cloud.resourcemanager.v3.TagBinding.getDefaultInstance() + : tagBinding_; + } else { + return tagBindingBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The TagBinding to be created.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTagBinding(com.google.cloud.resourcemanager.v3.TagBinding value) { + if (tagBindingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tagBinding_ = value; + onChanged(); + } else { + tagBindingBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The TagBinding to be created.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTagBinding( + com.google.cloud.resourcemanager.v3.TagBinding.Builder builderForValue) { + if (tagBindingBuilder_ == null) { + tagBinding_ = builderForValue.build(); + onChanged(); + } else { + tagBindingBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The TagBinding to be created.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeTagBinding(com.google.cloud.resourcemanager.v3.TagBinding value) { + if (tagBindingBuilder_ == null) { + if (tagBinding_ != null) { + tagBinding_ = + com.google.cloud.resourcemanager.v3.TagBinding.newBuilder(tagBinding_) + .mergeFrom(value) + .buildPartial(); + } else { + tagBinding_ = value; + } + onChanged(); + } else { + tagBindingBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The TagBinding to be created.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearTagBinding() { + if (tagBindingBuilder_ == null) { + tagBinding_ = null; + onChanged(); + } else { + tagBinding_ = null; + tagBindingBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The TagBinding to be created.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.resourcemanager.v3.TagBinding.Builder getTagBindingBuilder() { + + onChanged(); + return getTagBindingFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The TagBinding to be created.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.resourcemanager.v3.TagBindingOrBuilder getTagBindingOrBuilder() { + if (tagBindingBuilder_ != null) { + return tagBindingBuilder_.getMessageOrBuilder(); + } else { + return tagBinding_ == null + ? com.google.cloud.resourcemanager.v3.TagBinding.getDefaultInstance() + : tagBinding_; + } + } + /** + * + * + *
+     * Required. The TagBinding to be created.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.TagBinding, + com.google.cloud.resourcemanager.v3.TagBinding.Builder, + com.google.cloud.resourcemanager.v3.TagBindingOrBuilder> + getTagBindingFieldBuilder() { + if (tagBindingBuilder_ == null) { + tagBindingBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.TagBinding, + com.google.cloud.resourcemanager.v3.TagBinding.Builder, + com.google.cloud.resourcemanager.v3.TagBindingOrBuilder>( + getTagBinding(), getParentForChildren(), isClean()); + tagBinding_ = null; + } + return tagBindingBuilder_; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. Set to true to perform the validations necessary for creating the resource,
+     * but not actually perform the action.
+     * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. Set to true to perform the validations necessary for creating the resource,
+     * but not actually perform the action.
+     * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Set to true to perform the validations necessary for creating the resource,
+     * but not actually perform the action.
+     * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + + validateOnly_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.CreateTagBindingRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.CreateTagBindingRequest) + private static final com.google.cloud.resourcemanager.v3.CreateTagBindingRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.CreateTagBindingRequest(); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagBindingRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateTagBindingRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateTagBindingRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateTagBindingRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagBindingRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagBindingRequestOrBuilder.java new file mode 100644 index 000000000000..45020e136a16 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagBindingRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_bindings.proto + +package com.google.cloud.resourcemanager.v3; + +public interface CreateTagBindingRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.CreateTagBindingRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The TagBinding to be created.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the tagBinding field is set. + */ + boolean hasTagBinding(); + /** + * + * + *
+   * Required. The TagBinding to be created.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The tagBinding. + */ + com.google.cloud.resourcemanager.v3.TagBinding getTagBinding(); + /** + * + * + *
+   * Required. The TagBinding to be created.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagBinding tag_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.resourcemanager.v3.TagBindingOrBuilder getTagBindingOrBuilder(); + + /** + * + * + *
+   * Optional. Set to true to perform the validations necessary for creating the resource,
+   * but not actually perform the action.
+   * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagKeyMetadata.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagKeyMetadata.java new file mode 100644 index 000000000000..f455013d1abc --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagKeyMetadata.java @@ -0,0 +1,457 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_keys.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * Runtime operation information for creating a TagKey.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.CreateTagKeyMetadata} + */ +public final class CreateTagKeyMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.CreateTagKeyMetadata) + CreateTagKeyMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateTagKeyMetadata.newBuilder() to construct. + private CreateTagKeyMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateTagKeyMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateTagKeyMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateTagKeyMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagKeyMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagKeyMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata.class, + com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata other = + (com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Runtime operation information for creating a TagKey.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.CreateTagKeyMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.CreateTagKeyMetadata) + com.google.cloud.resourcemanager.v3.CreateTagKeyMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagKeyMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagKeyMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata.class, + com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagKeyMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata build() { + com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata buildPartial() { + com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata result = + new com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata) { + return mergeFrom((com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata other) { + if (other == com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.CreateTagKeyMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.CreateTagKeyMetadata) + private static final com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata(); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateTagKeyMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateTagKeyMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateTagKeyMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagKeyMetadataOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagKeyMetadataOrBuilder.java new file mode 100644 index 000000000000..185c0250f5c1 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagKeyMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_keys.proto + +package com.google.cloud.resourcemanager.v3; + +public interface CreateTagKeyMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.CreateTagKeyMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagKeyRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagKeyRequest.java new file mode 100644 index 000000000000..be8d18f01a09 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagKeyRequest.java @@ -0,0 +1,864 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_keys.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The request message for creating a TagKey.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.CreateTagKeyRequest} + */ +public final class CreateTagKeyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.CreateTagKeyRequest) + CreateTagKeyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateTagKeyRequest.newBuilder() to construct. + private CreateTagKeyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateTagKeyRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateTagKeyRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateTagKeyRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.resourcemanager.v3.TagKey.Builder subBuilder = null; + if (tagKey_ != null) { + subBuilder = tagKey_.toBuilder(); + } + tagKey_ = + input.readMessage( + com.google.cloud.resourcemanager.v3.TagKey.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(tagKey_); + tagKey_ = subBuilder.buildPartial(); + } + + break; + } + case 16: + { + validateOnly_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.CreateTagKeyRequest.class, + com.google.cloud.resourcemanager.v3.CreateTagKeyRequest.Builder.class); + } + + public static final int TAG_KEY_FIELD_NUMBER = 1; + private com.google.cloud.resourcemanager.v3.TagKey tagKey_; + /** + * + * + *
+   * Required. The TagKey to be created. Only fields `short_name`, `description`,
+   * and `parent` are considered during the creation request.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the tagKey field is set. + */ + @java.lang.Override + public boolean hasTagKey() { + return tagKey_ != null; + } + /** + * + * + *
+   * Required. The TagKey to be created. Only fields `short_name`, `description`,
+   * and `parent` are considered during the creation request.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The tagKey. + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagKey getTagKey() { + return tagKey_ == null + ? com.google.cloud.resourcemanager.v3.TagKey.getDefaultInstance() + : tagKey_; + } + /** + * + * + *
+   * Required. The TagKey to be created. Only fields `short_name`, `description`,
+   * and `parent` are considered during the creation request.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagKeyOrBuilder getTagKeyOrBuilder() { + return getTagKey(); + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 2; + private boolean validateOnly_; + /** + * + * + *
+   * Optional. Set to true to perform validations necessary for creating the resource, but
+   * not actually perform the action.
+   * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (tagKey_ != null) { + output.writeMessage(1, getTagKey()); + } + if (validateOnly_ != false) { + output.writeBool(2, validateOnly_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (tagKey_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getTagKey()); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, validateOnly_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.CreateTagKeyRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.CreateTagKeyRequest other = + (com.google.cloud.resourcemanager.v3.CreateTagKeyRequest) obj; + + if (hasTagKey() != other.hasTagKey()) return false; + if (hasTagKey()) { + if (!getTagKey().equals(other.getTagKey())) return false; + } + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasTagKey()) { + hash = (37 * hash) + TAG_KEY_FIELD_NUMBER; + hash = (53 * hash) + getTagKey().hashCode(); + } + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.CreateTagKeyRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for creating a TagKey.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.CreateTagKeyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.CreateTagKeyRequest) + com.google.cloud.resourcemanager.v3.CreateTagKeyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.CreateTagKeyRequest.class, + com.google.cloud.resourcemanager.v3.CreateTagKeyRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.CreateTagKeyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (tagKeyBuilder_ == null) { + tagKey_ = null; + } else { + tagKey_ = null; + tagKeyBuilder_ = null; + } + validateOnly_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagKeyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateTagKeyRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.CreateTagKeyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateTagKeyRequest build() { + com.google.cloud.resourcemanager.v3.CreateTagKeyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateTagKeyRequest buildPartial() { + com.google.cloud.resourcemanager.v3.CreateTagKeyRequest result = + new com.google.cloud.resourcemanager.v3.CreateTagKeyRequest(this); + if (tagKeyBuilder_ == null) { + result.tagKey_ = tagKey_; + } else { + result.tagKey_ = tagKeyBuilder_.build(); + } + result.validateOnly_ = validateOnly_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.CreateTagKeyRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.CreateTagKeyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.CreateTagKeyRequest other) { + if (other == com.google.cloud.resourcemanager.v3.CreateTagKeyRequest.getDefaultInstance()) + return this; + if (other.hasTagKey()) { + mergeTagKey(other.getTagKey()); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.CreateTagKeyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.CreateTagKeyRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.resourcemanager.v3.TagKey tagKey_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.TagKey, + com.google.cloud.resourcemanager.v3.TagKey.Builder, + com.google.cloud.resourcemanager.v3.TagKeyOrBuilder> + tagKeyBuilder_; + /** + * + * + *
+     * Required. The TagKey to be created. Only fields `short_name`, `description`,
+     * and `parent` are considered during the creation request.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the tagKey field is set. + */ + public boolean hasTagKey() { + return tagKeyBuilder_ != null || tagKey_ != null; + } + /** + * + * + *
+     * Required. The TagKey to be created. Only fields `short_name`, `description`,
+     * and `parent` are considered during the creation request.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The tagKey. + */ + public com.google.cloud.resourcemanager.v3.TagKey getTagKey() { + if (tagKeyBuilder_ == null) { + return tagKey_ == null + ? com.google.cloud.resourcemanager.v3.TagKey.getDefaultInstance() + : tagKey_; + } else { + return tagKeyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The TagKey to be created. Only fields `short_name`, `description`,
+     * and `parent` are considered during the creation request.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTagKey(com.google.cloud.resourcemanager.v3.TagKey value) { + if (tagKeyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tagKey_ = value; + onChanged(); + } else { + tagKeyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The TagKey to be created. Only fields `short_name`, `description`,
+     * and `parent` are considered during the creation request.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTagKey(com.google.cloud.resourcemanager.v3.TagKey.Builder builderForValue) { + if (tagKeyBuilder_ == null) { + tagKey_ = builderForValue.build(); + onChanged(); + } else { + tagKeyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The TagKey to be created. Only fields `short_name`, `description`,
+     * and `parent` are considered during the creation request.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeTagKey(com.google.cloud.resourcemanager.v3.TagKey value) { + if (tagKeyBuilder_ == null) { + if (tagKey_ != null) { + tagKey_ = + com.google.cloud.resourcemanager.v3.TagKey.newBuilder(tagKey_) + .mergeFrom(value) + .buildPartial(); + } else { + tagKey_ = value; + } + onChanged(); + } else { + tagKeyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The TagKey to be created. Only fields `short_name`, `description`,
+     * and `parent` are considered during the creation request.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearTagKey() { + if (tagKeyBuilder_ == null) { + tagKey_ = null; + onChanged(); + } else { + tagKey_ = null; + tagKeyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The TagKey to be created. Only fields `short_name`, `description`,
+     * and `parent` are considered during the creation request.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.resourcemanager.v3.TagKey.Builder getTagKeyBuilder() { + + onChanged(); + return getTagKeyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The TagKey to be created. Only fields `short_name`, `description`,
+     * and `parent` are considered during the creation request.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.resourcemanager.v3.TagKeyOrBuilder getTagKeyOrBuilder() { + if (tagKeyBuilder_ != null) { + return tagKeyBuilder_.getMessageOrBuilder(); + } else { + return tagKey_ == null + ? com.google.cloud.resourcemanager.v3.TagKey.getDefaultInstance() + : tagKey_; + } + } + /** + * + * + *
+     * Required. The TagKey to be created. Only fields `short_name`, `description`,
+     * and `parent` are considered during the creation request.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.TagKey, + com.google.cloud.resourcemanager.v3.TagKey.Builder, + com.google.cloud.resourcemanager.v3.TagKeyOrBuilder> + getTagKeyFieldBuilder() { + if (tagKeyBuilder_ == null) { + tagKeyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.TagKey, + com.google.cloud.resourcemanager.v3.TagKey.Builder, + com.google.cloud.resourcemanager.v3.TagKeyOrBuilder>( + getTagKey(), getParentForChildren(), isClean()); + tagKey_ = null; + } + return tagKeyBuilder_; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. Set to true to perform validations necessary for creating the resource, but
+     * not actually perform the action.
+     * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. Set to true to perform validations necessary for creating the resource, but
+     * not actually perform the action.
+     * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Set to true to perform validations necessary for creating the resource, but
+     * not actually perform the action.
+     * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + + validateOnly_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.CreateTagKeyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.CreateTagKeyRequest) + private static final com.google.cloud.resourcemanager.v3.CreateTagKeyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.CreateTagKeyRequest(); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagKeyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateTagKeyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateTagKeyRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateTagKeyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagKeyRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagKeyRequestOrBuilder.java new file mode 100644 index 000000000000..e9f51b0abe35 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagKeyRequestOrBuilder.java @@ -0,0 +1,83 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_keys.proto + +package com.google.cloud.resourcemanager.v3; + +public interface CreateTagKeyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.CreateTagKeyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The TagKey to be created. Only fields `short_name`, `description`,
+   * and `parent` are considered during the creation request.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the tagKey field is set. + */ + boolean hasTagKey(); + /** + * + * + *
+   * Required. The TagKey to be created. Only fields `short_name`, `description`,
+   * and `parent` are considered during the creation request.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The tagKey. + */ + com.google.cloud.resourcemanager.v3.TagKey getTagKey(); + /** + * + * + *
+   * Required. The TagKey to be created. Only fields `short_name`, `description`,
+   * and `parent` are considered during the creation request.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.resourcemanager.v3.TagKeyOrBuilder getTagKeyOrBuilder(); + + /** + * + * + *
+   * Optional. Set to true to perform validations necessary for creating the resource, but
+   * not actually perform the action.
+   * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagValueMetadata.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagValueMetadata.java new file mode 100644 index 000000000000..7314fa10567a --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagValueMetadata.java @@ -0,0 +1,457 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_values.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * Runtime operation information for creating a TagValue.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.CreateTagValueMetadata} + */ +public final class CreateTagValueMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.CreateTagValueMetadata) + CreateTagValueMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateTagValueMetadata.newBuilder() to construct. + private CreateTagValueMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateTagValueMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateTagValueMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateTagValueMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagValueMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagValueMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.CreateTagValueMetadata.class, + com.google.cloud.resourcemanager.v3.CreateTagValueMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.CreateTagValueMetadata)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.CreateTagValueMetadata other = + (com.google.cloud.resourcemanager.v3.CreateTagValueMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.CreateTagValueMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Runtime operation information for creating a TagValue.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.CreateTagValueMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.CreateTagValueMetadata) + com.google.cloud.resourcemanager.v3.CreateTagValueMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagValueMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagValueMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.CreateTagValueMetadata.class, + com.google.cloud.resourcemanager.v3.CreateTagValueMetadata.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.CreateTagValueMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagValueMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateTagValueMetadata getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.CreateTagValueMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateTagValueMetadata build() { + com.google.cloud.resourcemanager.v3.CreateTagValueMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateTagValueMetadata buildPartial() { + com.google.cloud.resourcemanager.v3.CreateTagValueMetadata result = + new com.google.cloud.resourcemanager.v3.CreateTagValueMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.CreateTagValueMetadata) { + return mergeFrom((com.google.cloud.resourcemanager.v3.CreateTagValueMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.CreateTagValueMetadata other) { + if (other == com.google.cloud.resourcemanager.v3.CreateTagValueMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.CreateTagValueMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.CreateTagValueMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.CreateTagValueMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.CreateTagValueMetadata) + private static final com.google.cloud.resourcemanager.v3.CreateTagValueMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.CreateTagValueMetadata(); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateTagValueMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateTagValueMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateTagValueMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagValueMetadataOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagValueMetadataOrBuilder.java new file mode 100644 index 000000000000..75d08ad304e8 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagValueMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_values.proto + +package com.google.cloud.resourcemanager.v3; + +public interface CreateTagValueMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.CreateTagValueMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagValueRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagValueRequest.java new file mode 100644 index 000000000000..48f0d9c63873 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagValueRequest.java @@ -0,0 +1,865 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_values.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The request message for creating a TagValue.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.CreateTagValueRequest} + */ +public final class CreateTagValueRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.CreateTagValueRequest) + CreateTagValueRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateTagValueRequest.newBuilder() to construct. + private CreateTagValueRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateTagValueRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateTagValueRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateTagValueRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.resourcemanager.v3.TagValue.Builder subBuilder = null; + if (tagValue_ != null) { + subBuilder = tagValue_.toBuilder(); + } + tagValue_ = + input.readMessage( + com.google.cloud.resourcemanager.v3.TagValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(tagValue_); + tagValue_ = subBuilder.buildPartial(); + } + + break; + } + case 16: + { + validateOnly_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagValueRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagValueRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.CreateTagValueRequest.class, + com.google.cloud.resourcemanager.v3.CreateTagValueRequest.Builder.class); + } + + public static final int TAG_VALUE_FIELD_NUMBER = 1; + private com.google.cloud.resourcemanager.v3.TagValue tagValue_; + /** + * + * + *
+   * Required. The TagValue to be created. Only fields `short_name`, `description`,
+   * and `parent` are considered during the creation request.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the tagValue field is set. + */ + @java.lang.Override + public boolean hasTagValue() { + return tagValue_ != null; + } + /** + * + * + *
+   * Required. The TagValue to be created. Only fields `short_name`, `description`,
+   * and `parent` are considered during the creation request.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The tagValue. + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagValue getTagValue() { + return tagValue_ == null + ? com.google.cloud.resourcemanager.v3.TagValue.getDefaultInstance() + : tagValue_; + } + /** + * + * + *
+   * Required. The TagValue to be created. Only fields `short_name`, `description`,
+   * and `parent` are considered during the creation request.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagValueOrBuilder getTagValueOrBuilder() { + return getTagValue(); + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 2; + private boolean validateOnly_; + /** + * + * + *
+   * Optional. Set as true to perform the validations necessary for creating the resource,
+   * but not actually perform the action.
+   * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (tagValue_ != null) { + output.writeMessage(1, getTagValue()); + } + if (validateOnly_ != false) { + output.writeBool(2, validateOnly_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (tagValue_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getTagValue()); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, validateOnly_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.CreateTagValueRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.CreateTagValueRequest other = + (com.google.cloud.resourcemanager.v3.CreateTagValueRequest) obj; + + if (hasTagValue() != other.hasTagValue()) return false; + if (hasTagValue()) { + if (!getTagValue().equals(other.getTagValue())) return false; + } + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasTagValue()) { + hash = (37 * hash) + TAG_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getTagValue().hashCode(); + } + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.CreateTagValueRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for creating a TagValue.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.CreateTagValueRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.CreateTagValueRequest) + com.google.cloud.resourcemanager.v3.CreateTagValueRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagValueRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagValueRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.CreateTagValueRequest.class, + com.google.cloud.resourcemanager.v3.CreateTagValueRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.CreateTagValueRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (tagValueBuilder_ == null) { + tagValue_ = null; + } else { + tagValue_ = null; + tagValueBuilder_ = null; + } + validateOnly_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_CreateTagValueRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateTagValueRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.CreateTagValueRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateTagValueRequest build() { + com.google.cloud.resourcemanager.v3.CreateTagValueRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateTagValueRequest buildPartial() { + com.google.cloud.resourcemanager.v3.CreateTagValueRequest result = + new com.google.cloud.resourcemanager.v3.CreateTagValueRequest(this); + if (tagValueBuilder_ == null) { + result.tagValue_ = tagValue_; + } else { + result.tagValue_ = tagValueBuilder_.build(); + } + result.validateOnly_ = validateOnly_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.CreateTagValueRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.CreateTagValueRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.CreateTagValueRequest other) { + if (other == com.google.cloud.resourcemanager.v3.CreateTagValueRequest.getDefaultInstance()) + return this; + if (other.hasTagValue()) { + mergeTagValue(other.getTagValue()); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.CreateTagValueRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.CreateTagValueRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.resourcemanager.v3.TagValue tagValue_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.TagValue, + com.google.cloud.resourcemanager.v3.TagValue.Builder, + com.google.cloud.resourcemanager.v3.TagValueOrBuilder> + tagValueBuilder_; + /** + * + * + *
+     * Required. The TagValue to be created. Only fields `short_name`, `description`,
+     * and `parent` are considered during the creation request.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the tagValue field is set. + */ + public boolean hasTagValue() { + return tagValueBuilder_ != null || tagValue_ != null; + } + /** + * + * + *
+     * Required. The TagValue to be created. Only fields `short_name`, `description`,
+     * and `parent` are considered during the creation request.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The tagValue. + */ + public com.google.cloud.resourcemanager.v3.TagValue getTagValue() { + if (tagValueBuilder_ == null) { + return tagValue_ == null + ? com.google.cloud.resourcemanager.v3.TagValue.getDefaultInstance() + : tagValue_; + } else { + return tagValueBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The TagValue to be created. Only fields `short_name`, `description`,
+     * and `parent` are considered during the creation request.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTagValue(com.google.cloud.resourcemanager.v3.TagValue value) { + if (tagValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tagValue_ = value; + onChanged(); + } else { + tagValueBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The TagValue to be created. Only fields `short_name`, `description`,
+     * and `parent` are considered during the creation request.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTagValue( + com.google.cloud.resourcemanager.v3.TagValue.Builder builderForValue) { + if (tagValueBuilder_ == null) { + tagValue_ = builderForValue.build(); + onChanged(); + } else { + tagValueBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The TagValue to be created. Only fields `short_name`, `description`,
+     * and `parent` are considered during the creation request.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeTagValue(com.google.cloud.resourcemanager.v3.TagValue value) { + if (tagValueBuilder_ == null) { + if (tagValue_ != null) { + tagValue_ = + com.google.cloud.resourcemanager.v3.TagValue.newBuilder(tagValue_) + .mergeFrom(value) + .buildPartial(); + } else { + tagValue_ = value; + } + onChanged(); + } else { + tagValueBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The TagValue to be created. Only fields `short_name`, `description`,
+     * and `parent` are considered during the creation request.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearTagValue() { + if (tagValueBuilder_ == null) { + tagValue_ = null; + onChanged(); + } else { + tagValue_ = null; + tagValueBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The TagValue to be created. Only fields `short_name`, `description`,
+     * and `parent` are considered during the creation request.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.resourcemanager.v3.TagValue.Builder getTagValueBuilder() { + + onChanged(); + return getTagValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The TagValue to be created. Only fields `short_name`, `description`,
+     * and `parent` are considered during the creation request.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.resourcemanager.v3.TagValueOrBuilder getTagValueOrBuilder() { + if (tagValueBuilder_ != null) { + return tagValueBuilder_.getMessageOrBuilder(); + } else { + return tagValue_ == null + ? com.google.cloud.resourcemanager.v3.TagValue.getDefaultInstance() + : tagValue_; + } + } + /** + * + * + *
+     * Required. The TagValue to be created. Only fields `short_name`, `description`,
+     * and `parent` are considered during the creation request.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.TagValue, + com.google.cloud.resourcemanager.v3.TagValue.Builder, + com.google.cloud.resourcemanager.v3.TagValueOrBuilder> + getTagValueFieldBuilder() { + if (tagValueBuilder_ == null) { + tagValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.TagValue, + com.google.cloud.resourcemanager.v3.TagValue.Builder, + com.google.cloud.resourcemanager.v3.TagValueOrBuilder>( + getTagValue(), getParentForChildren(), isClean()); + tagValue_ = null; + } + return tagValueBuilder_; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. Set as true to perform the validations necessary for creating the resource,
+     * but not actually perform the action.
+     * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. Set as true to perform the validations necessary for creating the resource,
+     * but not actually perform the action.
+     * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Set as true to perform the validations necessary for creating the resource,
+     * but not actually perform the action.
+     * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + + validateOnly_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.CreateTagValueRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.CreateTagValueRequest) + private static final com.google.cloud.resourcemanager.v3.CreateTagValueRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.CreateTagValueRequest(); + } + + public static com.google.cloud.resourcemanager.v3.CreateTagValueRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateTagValueRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateTagValueRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.CreateTagValueRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagValueRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagValueRequestOrBuilder.java new file mode 100644 index 000000000000..17b9062935c3 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/CreateTagValueRequestOrBuilder.java @@ -0,0 +1,83 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_values.proto + +package com.google.cloud.resourcemanager.v3; + +public interface CreateTagValueRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.CreateTagValueRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The TagValue to be created. Only fields `short_name`, `description`,
+   * and `parent` are considered during the creation request.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the tagValue field is set. + */ + boolean hasTagValue(); + /** + * + * + *
+   * Required. The TagValue to be created. Only fields `short_name`, `description`,
+   * and `parent` are considered during the creation request.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The tagValue. + */ + com.google.cloud.resourcemanager.v3.TagValue getTagValue(); + /** + * + * + *
+   * Required. The TagValue to be created. Only fields `short_name`, `description`,
+   * and `parent` are considered during the creation request.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.resourcemanager.v3.TagValueOrBuilder getTagValueOrBuilder(); + + /** + * + * + *
+   * Optional. Set as true to perform the validations necessary for creating the resource,
+   * but not actually perform the action.
+   * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteFolderMetadata.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteFolderMetadata.java new file mode 100644 index 000000000000..f9573afd1780 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteFolderMetadata.java @@ -0,0 +1,459 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * A status object which is used as the `metadata` field for the `Operation`
+ * returned by `DeleteFolder`.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.DeleteFolderMetadata} + */ +public final class DeleteFolderMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.DeleteFolderMetadata) + DeleteFolderMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteFolderMetadata.newBuilder() to construct. + private DeleteFolderMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteFolderMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteFolderMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteFolderMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_DeleteFolderMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_DeleteFolderMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.DeleteFolderMetadata.class, + com.google.cloud.resourcemanager.v3.DeleteFolderMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.DeleteFolderMetadata)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.DeleteFolderMetadata other = + (com.google.cloud.resourcemanager.v3.DeleteFolderMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.DeleteFolderMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A status object which is used as the `metadata` field for the `Operation`
+   * returned by `DeleteFolder`.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.DeleteFolderMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.DeleteFolderMetadata) + com.google.cloud.resourcemanager.v3.DeleteFolderMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_DeleteFolderMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_DeleteFolderMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.DeleteFolderMetadata.class, + com.google.cloud.resourcemanager.v3.DeleteFolderMetadata.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.DeleteFolderMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_DeleteFolderMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteFolderMetadata getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.DeleteFolderMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteFolderMetadata build() { + com.google.cloud.resourcemanager.v3.DeleteFolderMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteFolderMetadata buildPartial() { + com.google.cloud.resourcemanager.v3.DeleteFolderMetadata result = + new com.google.cloud.resourcemanager.v3.DeleteFolderMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.DeleteFolderMetadata) { + return mergeFrom((com.google.cloud.resourcemanager.v3.DeleteFolderMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.DeleteFolderMetadata other) { + if (other == com.google.cloud.resourcemanager.v3.DeleteFolderMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.DeleteFolderMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.DeleteFolderMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.DeleteFolderMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.DeleteFolderMetadata) + private static final com.google.cloud.resourcemanager.v3.DeleteFolderMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.DeleteFolderMetadata(); + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteFolderMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteFolderMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteFolderMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteFolderMetadataOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteFolderMetadataOrBuilder.java new file mode 100644 index 000000000000..dd8a89e55273 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteFolderMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +public interface DeleteFolderMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.DeleteFolderMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteFolderRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteFolderRequest.java new file mode 100644 index 000000000000..33cf0178e3c9 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteFolderRequest.java @@ -0,0 +1,658 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The DeleteFolder request message.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.DeleteFolderRequest} + */ +public final class DeleteFolderRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.DeleteFolderRequest) + DeleteFolderRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteFolderRequest.newBuilder() to construct. + private DeleteFolderRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteFolderRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteFolderRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteFolderRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_DeleteFolderRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_DeleteFolderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.DeleteFolderRequest.class, + com.google.cloud.resourcemanager.v3.DeleteFolderRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the folder to be deleted.
+   * Must be of the form `folders/{folder_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the folder to be deleted.
+   * Must be of the form `folders/{folder_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.DeleteFolderRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.DeleteFolderRequest other = + (com.google.cloud.resourcemanager.v3.DeleteFolderRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.DeleteFolderRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The DeleteFolder request message.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.DeleteFolderRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.DeleteFolderRequest) + com.google.cloud.resourcemanager.v3.DeleteFolderRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_DeleteFolderRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_DeleteFolderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.DeleteFolderRequest.class, + com.google.cloud.resourcemanager.v3.DeleteFolderRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.DeleteFolderRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_DeleteFolderRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteFolderRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.DeleteFolderRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteFolderRequest build() { + com.google.cloud.resourcemanager.v3.DeleteFolderRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteFolderRequest buildPartial() { + com.google.cloud.resourcemanager.v3.DeleteFolderRequest result = + new com.google.cloud.resourcemanager.v3.DeleteFolderRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.DeleteFolderRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.DeleteFolderRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.DeleteFolderRequest other) { + if (other == com.google.cloud.resourcemanager.v3.DeleteFolderRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.DeleteFolderRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.DeleteFolderRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the folder to be deleted.
+     * Must be of the form `folders/{folder_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the folder to be deleted.
+     * Must be of the form `folders/{folder_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the folder to be deleted.
+     * Must be of the form `folders/{folder_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the folder to be deleted.
+     * Must be of the form `folders/{folder_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the folder to be deleted.
+     * Must be of the form `folders/{folder_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.DeleteFolderRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.DeleteFolderRequest) + private static final com.google.cloud.resourcemanager.v3.DeleteFolderRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.DeleteFolderRequest(); + } + + public static com.google.cloud.resourcemanager.v3.DeleteFolderRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteFolderRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteFolderRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteFolderRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteFolderRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteFolderRequestOrBuilder.java new file mode 100644 index 000000000000..a446e7cb6d72 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteFolderRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +public interface DeleteFolderRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.DeleteFolderRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the folder to be deleted.
+   * Must be of the form `folders/{folder_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the folder to be deleted.
+   * Must be of the form `folders/{folder_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteOrganizationMetadata.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteOrganizationMetadata.java new file mode 100644 index 000000000000..0938612c39c1 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteOrganizationMetadata.java @@ -0,0 +1,465 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/organizations.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * A status object which is used as the `metadata` field for the operation
+ * returned by DeleteOrganization.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.DeleteOrganizationMetadata} + */ +public final class DeleteOrganizationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.DeleteOrganizationMetadata) + DeleteOrganizationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteOrganizationMetadata.newBuilder() to construct. + private DeleteOrganizationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteOrganizationMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteOrganizationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteOrganizationMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_DeleteOrganizationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_DeleteOrganizationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata.class, + com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata other = + (com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A status object which is used as the `metadata` field for the operation
+   * returned by DeleteOrganization.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.DeleteOrganizationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.DeleteOrganizationMetadata) + com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_DeleteOrganizationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_DeleteOrganizationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata.class, + com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_DeleteOrganizationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata + getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata build() { + com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata buildPartial() { + com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata result = + new com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata) { + return mergeFrom((com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata other) { + if (other + == com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.DeleteOrganizationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.DeleteOrganizationMetadata) + private static final com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata(); + } + + public static com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteOrganizationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteOrganizationMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteOrganizationMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteOrganizationMetadataOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteOrganizationMetadataOrBuilder.java new file mode 100644 index 000000000000..79e6b8a75dcf --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteOrganizationMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/organizations.proto + +package com.google.cloud.resourcemanager.v3; + +public interface DeleteOrganizationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.DeleteOrganizationMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteProjectMetadata.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteProjectMetadata.java new file mode 100644 index 000000000000..73c79eebd072 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteProjectMetadata.java @@ -0,0 +1,459 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * A status object which is used as the `metadata` field for the Operation
+ * returned by `DeleteProject`.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.DeleteProjectMetadata} + */ +public final class DeleteProjectMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.DeleteProjectMetadata) + DeleteProjectMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteProjectMetadata.newBuilder() to construct. + private DeleteProjectMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteProjectMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteProjectMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteProjectMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_DeleteProjectMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_DeleteProjectMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.DeleteProjectMetadata.class, + com.google.cloud.resourcemanager.v3.DeleteProjectMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.DeleteProjectMetadata)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.DeleteProjectMetadata other = + (com.google.cloud.resourcemanager.v3.DeleteProjectMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.DeleteProjectMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A status object which is used as the `metadata` field for the Operation
+   * returned by `DeleteProject`.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.DeleteProjectMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.DeleteProjectMetadata) + com.google.cloud.resourcemanager.v3.DeleteProjectMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_DeleteProjectMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_DeleteProjectMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.DeleteProjectMetadata.class, + com.google.cloud.resourcemanager.v3.DeleteProjectMetadata.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.DeleteProjectMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_DeleteProjectMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteProjectMetadata getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.DeleteProjectMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteProjectMetadata build() { + com.google.cloud.resourcemanager.v3.DeleteProjectMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteProjectMetadata buildPartial() { + com.google.cloud.resourcemanager.v3.DeleteProjectMetadata result = + new com.google.cloud.resourcemanager.v3.DeleteProjectMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.DeleteProjectMetadata) { + return mergeFrom((com.google.cloud.resourcemanager.v3.DeleteProjectMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.DeleteProjectMetadata other) { + if (other == com.google.cloud.resourcemanager.v3.DeleteProjectMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.DeleteProjectMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.DeleteProjectMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.DeleteProjectMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.DeleteProjectMetadata) + private static final com.google.cloud.resourcemanager.v3.DeleteProjectMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.DeleteProjectMetadata(); + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteProjectMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteProjectMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteProjectMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteProjectMetadataOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteProjectMetadataOrBuilder.java new file mode 100644 index 000000000000..52f2a3b6d270 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteProjectMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +public interface DeleteProjectMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.DeleteProjectMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteProjectRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteProjectRequest.java new file mode 100644 index 000000000000..37b385cc8dbc --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteProjectRequest.java @@ -0,0 +1,653 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * [DeleteProject][google.cloud.resourcemanager.v3.Projects.DeleteProject]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.DeleteProjectRequest} + */ +public final class DeleteProjectRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.DeleteProjectRequest) + DeleteProjectRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteProjectRequest.newBuilder() to construct. + private DeleteProjectRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteProjectRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteProjectRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteProjectRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_DeleteProjectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_DeleteProjectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.DeleteProjectRequest.class, + com.google.cloud.resourcemanager.v3.DeleteProjectRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the Project (for example, `projects/415104041262`).
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the Project (for example, `projects/415104041262`).
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.DeleteProjectRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.DeleteProjectRequest other = + (com.google.cloud.resourcemanager.v3.DeleteProjectRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.DeleteProjectRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * [DeleteProject][google.cloud.resourcemanager.v3.Projects.DeleteProject]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.DeleteProjectRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.DeleteProjectRequest) + com.google.cloud.resourcemanager.v3.DeleteProjectRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_DeleteProjectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_DeleteProjectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.DeleteProjectRequest.class, + com.google.cloud.resourcemanager.v3.DeleteProjectRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.DeleteProjectRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_DeleteProjectRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteProjectRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.DeleteProjectRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteProjectRequest build() { + com.google.cloud.resourcemanager.v3.DeleteProjectRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteProjectRequest buildPartial() { + com.google.cloud.resourcemanager.v3.DeleteProjectRequest result = + new com.google.cloud.resourcemanager.v3.DeleteProjectRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.DeleteProjectRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.DeleteProjectRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.DeleteProjectRequest other) { + if (other == com.google.cloud.resourcemanager.v3.DeleteProjectRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.DeleteProjectRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.DeleteProjectRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the Project (for example, `projects/415104041262`).
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the Project (for example, `projects/415104041262`).
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the Project (for example, `projects/415104041262`).
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Project (for example, `projects/415104041262`).
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Project (for example, `projects/415104041262`).
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.DeleteProjectRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.DeleteProjectRequest) + private static final com.google.cloud.resourcemanager.v3.DeleteProjectRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.DeleteProjectRequest(); + } + + public static com.google.cloud.resourcemanager.v3.DeleteProjectRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteProjectRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteProjectRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteProjectRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteProjectRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteProjectRequestOrBuilder.java new file mode 100644 index 000000000000..137fb572d199 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteProjectRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +public interface DeleteProjectRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.DeleteProjectRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Project (for example, `projects/415104041262`).
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the Project (for example, `projects/415104041262`).
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagBindingMetadata.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagBindingMetadata.java new file mode 100644 index 000000000000..f01fc36c83a5 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagBindingMetadata.java @@ -0,0 +1,460 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_bindings.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * Runtime operation information for deleting a TagBinding.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.DeleteTagBindingMetadata} + */ +public final class DeleteTagBindingMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.DeleteTagBindingMetadata) + DeleteTagBindingMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteTagBindingMetadata.newBuilder() to construct. + private DeleteTagBindingMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteTagBindingMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteTagBindingMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteTagBindingMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagBindingMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagBindingMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata.class, + com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata other = + (com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Runtime operation information for deleting a TagBinding.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.DeleteTagBindingMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.DeleteTagBindingMetadata) + com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagBindingMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagBindingMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata.class, + com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagBindingMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata + getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata build() { + com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata buildPartial() { + com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata result = + new com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata) { + return mergeFrom((com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata other) { + if (other + == com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.DeleteTagBindingMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.DeleteTagBindingMetadata) + private static final com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata(); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteTagBindingMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteTagBindingMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteTagBindingMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagBindingMetadataOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagBindingMetadataOrBuilder.java new file mode 100644 index 000000000000..56d9f9b4b240 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagBindingMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_bindings.proto + +package com.google.cloud.resourcemanager.v3; + +public interface DeleteTagBindingMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.DeleteTagBindingMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagBindingRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagBindingRequest.java new file mode 100644 index 000000000000..4ba3a30d2507 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagBindingRequest.java @@ -0,0 +1,665 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_bindings.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The request message to delete a TagBinding.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.DeleteTagBindingRequest} + */ +public final class DeleteTagBindingRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.DeleteTagBindingRequest) + DeleteTagBindingRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteTagBindingRequest.newBuilder() to construct. + private DeleteTagBindingRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteTagBindingRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteTagBindingRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteTagBindingRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagBindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagBindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest.class, + com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object 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`).
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * 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`).
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest other = + (com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message to delete a TagBinding.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.DeleteTagBindingRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.DeleteTagBindingRequest) + com.google.cloud.resourcemanager.v3.DeleteTagBindingRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagBindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagBindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest.class, + com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagBindingRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest build() { + com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest buildPartial() { + com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest result = + new com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest other) { + if (other == com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object 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`).
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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`).
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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`).
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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`).
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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`).
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.DeleteTagBindingRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.DeleteTagBindingRequest) + private static final com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest(); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteTagBindingRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteTagBindingRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteTagBindingRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagBindingRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagBindingRequestOrBuilder.java new file mode 100644 index 000000000000..b6149b0fda2a --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagBindingRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_bindings.proto + +package com.google.cloud.resourcemanager.v3; + +public interface DeleteTagBindingRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.DeleteTagBindingRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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`).
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * 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`).
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagKeyMetadata.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagKeyMetadata.java new file mode 100644 index 000000000000..6fd7360477b4 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagKeyMetadata.java @@ -0,0 +1,457 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_keys.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * Runtime operation information for deleting a TagKey.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.DeleteTagKeyMetadata} + */ +public final class DeleteTagKeyMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.DeleteTagKeyMetadata) + DeleteTagKeyMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteTagKeyMetadata.newBuilder() to construct. + private DeleteTagKeyMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteTagKeyMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteTagKeyMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteTagKeyMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagKeyMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagKeyMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata.class, + com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata other = + (com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Runtime operation information for deleting a TagKey.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.DeleteTagKeyMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.DeleteTagKeyMetadata) + com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagKeyMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagKeyMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata.class, + com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagKeyMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata build() { + com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata buildPartial() { + com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata result = + new com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata) { + return mergeFrom((com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata other) { + if (other == com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.DeleteTagKeyMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.DeleteTagKeyMetadata) + private static final com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata(); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteTagKeyMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteTagKeyMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteTagKeyMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagKeyMetadataOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagKeyMetadataOrBuilder.java new file mode 100644 index 000000000000..e9ca1337307f --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagKeyMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_keys.proto + +package com.google.cloud.resourcemanager.v3; + +public interface DeleteTagKeyMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.DeleteTagKeyMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagKeyRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagKeyRequest.java new file mode 100644 index 000000000000..c2b755baad0b --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagKeyRequest.java @@ -0,0 +1,945 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_keys.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The request message for deleting a TagKey.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.DeleteTagKeyRequest} + */ +public final class DeleteTagKeyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.DeleteTagKeyRequest) + DeleteTagKeyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteTagKeyRequest.newBuilder() to construct. + private DeleteTagKeyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteTagKeyRequest() { + name_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteTagKeyRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteTagKeyRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: + { + validateOnly_ = input.readBool(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + etag_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest.class, + com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object 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.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * 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.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 2; + private boolean validateOnly_; + /** + * + * + *
+   * Optional. Set as true to perform validations necessary for deletion, but not actually
+   * perform the action.
+   * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ETAG_FIELD_NUMBER = 3; + private volatile java.lang.Object etag_; + /** + * + * + *
+   * Optional. The etag known to the client for the expected state of the TagKey. This is
+   * to be used for optimistic concurrency.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The etag known to the client for the expected state of the TagKey. This is
+   * to be used for optimistic concurrency.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (validateOnly_ != false) { + output.writeBool(2, validateOnly_); + } + if (!getEtagBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, etag_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, validateOnly_); + } + if (!getEtagBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, etag_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest other = + (com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for deleting a TagKey.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.DeleteTagKeyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.DeleteTagKeyRequest) + com.google.cloud.resourcemanager.v3.DeleteTagKeyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest.class, + com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + validateOnly_ = false; + + etag_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagKeyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest build() { + com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest buildPartial() { + com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest result = + new com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest(this); + result.name_ = name_; + result.validateOnly_ = validateOnly_; + result.etag_ = etag_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest other) { + if (other == com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object 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.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. Set as true to perform validations necessary for deletion, but not actually
+     * perform the action.
+     * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. Set as true to perform validations necessary for deletion, but not actually
+     * perform the action.
+     * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Set as true to perform validations necessary for deletion, but not actually
+     * perform the action.
+     * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + + validateOnly_ = false; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. The etag known to the client for the expected state of the TagKey. This is
+     * to be used for optimistic concurrency.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The etag known to the client for the expected state of the TagKey. This is
+     * to be used for optimistic concurrency.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The etag known to the client for the expected state of the TagKey. This is
+     * to be used for optimistic concurrency.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + etag_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The etag known to the client for the expected state of the TagKey. This is
+     * to be used for optimistic concurrency.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + + etag_ = getDefaultInstance().getEtag(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The etag known to the client for the expected state of the TagKey. This is
+     * to be used for optimistic concurrency.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + etag_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.DeleteTagKeyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.DeleteTagKeyRequest) + private static final com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest(); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteTagKeyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteTagKeyRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteTagKeyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagKeyRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagKeyRequestOrBuilder.java new file mode 100644 index 000000000000..36ebc4e398db --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagKeyRequestOrBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_keys.proto + +package com.google.cloud.resourcemanager.v3; + +public interface DeleteTagKeyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.DeleteTagKeyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * 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.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. Set as true to perform validations necessary for deletion, but not actually
+   * perform the action.
+   * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * Optional. The etag known to the client for the expected state of the TagKey. This is
+   * to be used for optimistic concurrency.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. The etag known to the client for the expected state of the TagKey. This is
+   * to be used for optimistic concurrency.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagValueMetadata.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagValueMetadata.java new file mode 100644 index 000000000000..526547fd45ea --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagValueMetadata.java @@ -0,0 +1,457 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_values.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * Runtime operation information for deleting a TagValue.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.DeleteTagValueMetadata} + */ +public final class DeleteTagValueMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.DeleteTagValueMetadata) + DeleteTagValueMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteTagValueMetadata.newBuilder() to construct. + private DeleteTagValueMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteTagValueMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteTagValueMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteTagValueMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagValueMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagValueMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata.class, + com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata other = + (com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Runtime operation information for deleting a TagValue.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.DeleteTagValueMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.DeleteTagValueMetadata) + com.google.cloud.resourcemanager.v3.DeleteTagValueMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagValueMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagValueMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata.class, + com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagValueMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata build() { + com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata buildPartial() { + com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata result = + new com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata) { + return mergeFrom((com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata other) { + if (other == com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.DeleteTagValueMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.DeleteTagValueMetadata) + private static final com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata(); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteTagValueMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteTagValueMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteTagValueMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagValueMetadataOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagValueMetadataOrBuilder.java new file mode 100644 index 000000000000..410293605850 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagValueMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_values.proto + +package com.google.cloud.resourcemanager.v3; + +public interface DeleteTagValueMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.DeleteTagValueMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagValueRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagValueRequest.java new file mode 100644 index 000000000000..ea02829cfd9d --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagValueRequest.java @@ -0,0 +1,931 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_values.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The request message for deleting a TagValue.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.DeleteTagValueRequest} + */ +public final class DeleteTagValueRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.DeleteTagValueRequest) + DeleteTagValueRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteTagValueRequest.newBuilder() to construct. + private DeleteTagValueRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteTagValueRequest() { + name_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteTagValueRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteTagValueRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: + { + validateOnly_ = input.readBool(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + etag_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagValueRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagValueRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.DeleteTagValueRequest.class, + com.google.cloud.resourcemanager.v3.DeleteTagValueRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Resource name for TagValue to be deleted in the format tagValues/456.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Resource name for TagValue to be deleted in the format tagValues/456.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 2; + private boolean validateOnly_; + /** + * + * + *
+   * Optional. Set as true to perform the validations necessary for deletion, but not
+   * actually perform the action.
+   * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int ETAG_FIELD_NUMBER = 3; + private volatile java.lang.Object etag_; + /** + * + * + *
+   * Optional. The etag known to the client for the expected state of the TagValue. This
+   * is to be used for optimistic concurrency.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The etag known to the client for the expected state of the TagValue. This
+   * is to be used for optimistic concurrency.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (validateOnly_ != false) { + output.writeBool(2, validateOnly_); + } + if (!getEtagBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, etag_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, validateOnly_); + } + if (!getEtagBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, etag_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.DeleteTagValueRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.DeleteTagValueRequest other = + (com.google.cloud.resourcemanager.v3.DeleteTagValueRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.DeleteTagValueRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for deleting a TagValue.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.DeleteTagValueRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.DeleteTagValueRequest) + com.google.cloud.resourcemanager.v3.DeleteTagValueRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagValueRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagValueRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.DeleteTagValueRequest.class, + com.google.cloud.resourcemanager.v3.DeleteTagValueRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.DeleteTagValueRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + validateOnly_ = false; + + etag_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_DeleteTagValueRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteTagValueRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.DeleteTagValueRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteTagValueRequest build() { + com.google.cloud.resourcemanager.v3.DeleteTagValueRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteTagValueRequest buildPartial() { + com.google.cloud.resourcemanager.v3.DeleteTagValueRequest result = + new com.google.cloud.resourcemanager.v3.DeleteTagValueRequest(this); + result.name_ = name_; + result.validateOnly_ = validateOnly_; + result.etag_ = etag_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.DeleteTagValueRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.DeleteTagValueRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.DeleteTagValueRequest other) { + if (other == com.google.cloud.resourcemanager.v3.DeleteTagValueRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.DeleteTagValueRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.DeleteTagValueRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Resource name for TagValue to be deleted in the format tagValues/456.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Resource name for TagValue to be deleted in the format tagValues/456.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Resource name for TagValue to be deleted in the format tagValues/456.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name for TagValue to be deleted in the format tagValues/456.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name for TagValue to be deleted in the format tagValues/456.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. Set as true to perform the validations necessary for deletion, but not
+     * actually perform the action.
+     * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. Set as true to perform the validations necessary for deletion, but not
+     * actually perform the action.
+     * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Set as true to perform the validations necessary for deletion, but not
+     * actually perform the action.
+     * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + + validateOnly_ = false; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. The etag known to the client for the expected state of the TagValue. This
+     * is to be used for optimistic concurrency.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The etag known to the client for the expected state of the TagValue. This
+     * is to be used for optimistic concurrency.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The etag known to the client for the expected state of the TagValue. This
+     * is to be used for optimistic concurrency.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + etag_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The etag known to the client for the expected state of the TagValue. This
+     * is to be used for optimistic concurrency.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + + etag_ = getDefaultInstance().getEtag(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The etag known to the client for the expected state of the TagValue. This
+     * is to be used for optimistic concurrency.
+     * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + etag_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.DeleteTagValueRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.DeleteTagValueRequest) + private static final com.google.cloud.resourcemanager.v3.DeleteTagValueRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.DeleteTagValueRequest(); + } + + public static com.google.cloud.resourcemanager.v3.DeleteTagValueRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteTagValueRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteTagValueRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.DeleteTagValueRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagValueRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagValueRequestOrBuilder.java new file mode 100644 index 000000000000..ea0ec41dd0f1 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/DeleteTagValueRequestOrBuilder.java @@ -0,0 +1,95 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_values.proto + +package com.google.cloud.resourcemanager.v3; + +public interface DeleteTagValueRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.DeleteTagValueRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Resource name for TagValue to be deleted in the format tagValues/456.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Resource name for TagValue to be deleted in the format tagValues/456.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. Set as true to perform the validations necessary for deletion, but not
+   * actually perform the action.
+   * 
+ * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * Optional. The etag known to the client for the expected state of the TagValue. This
+   * is to be used for optimistic concurrency.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. The etag known to the client for the expected state of the TagValue. This
+   * is to be used for optimistic concurrency.
+   * 
+ * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/Folder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/Folder.java new file mode 100644 index 000000000000..faa3a6d5c8e8 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/Folder.java @@ -0,0 +1,2473 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * A folder in an organization's resource hierarchy, used to
+ * organize that organization's resources.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.Folder} + */ +public final class Folder extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.Folder) + FolderOrBuilder { + private static final long serialVersionUID = 0L; + // Use Folder.newBuilder() to construct. + private Folder(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Folder() { + name_ = ""; + parent_ = ""; + displayName_ = ""; + state_ = 0; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Folder(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Folder( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 32: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 58: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (deleteTime_ != null) { + subBuilder = deleteTime_.toBuilder(); + } + deleteTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deleteTime_); + deleteTime_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + etag_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_Folder_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_Folder_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.Folder.class, + com.google.cloud.resourcemanager.v3.Folder.Builder.class); + } + + /** + * + * + *
+   * Folder lifecycle states.
+   * 
+ * + * Protobuf enum {@code google.cloud.resourcemanager.v3.Folder.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The normal and active state.
+     * 
+ * + * ACTIVE = 1; + */ + ACTIVE(1), + /** + * + * + *
+     * The folder has been marked for deletion by the user.
+     * 
+ * + * DELETE_REQUESTED = 2; + */ + DELETE_REQUESTED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The normal and active state.
+     * 
+ * + * ACTIVE = 1; + */ + public static final int ACTIVE_VALUE = 1; + /** + * + * + *
+     * The folder has been marked for deletion by the user.
+     * 
+ * + * DELETE_REQUESTED = 2; + */ + public static final int DELETE_REQUESTED_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return ACTIVE; + case 2: + return DELETE_REQUESTED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.Folder.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.resourcemanager.v3.Folder.State) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. The resource name of the folder.
+   * Its format is `folders/{folder_id}`, for example: "folders/1234".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The resource name of the folder.
+   * Its format is `folders/{folder_id}`, for example: "folders/1234".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARENT_FIELD_NUMBER = 2; + private volatile java.lang.Object 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].
+   * 
+ * + * string parent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * 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].
+   * 
+ * + * string parent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 3; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * 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}])?`.
+   * 
+ * + * string display_name = 3; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * 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}])?`.
+   * 
+ * + * string display_name = 3; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 4; + private 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].
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return 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].
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Folder.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.resourcemanager.v3.Folder.State result = + com.google.cloud.resourcemanager.v3.Folder.State.valueOf(state_); + return result == null ? com.google.cloud.resourcemanager.v3.Folder.State.UNRECOGNIZED : result; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Timestamp when the folder was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Timestamp when the folder was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Timestamp when the folder was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Timestamp when the folder was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Timestamp when the folder was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Timestamp when the folder was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int DELETE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp deleteTime_; + /** + * + * + *
+   * Output only. Timestamp when the folder was requested to be deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + @java.lang.Override + public boolean hasDeleteTime() { + return deleteTime_ != null; + } + /** + * + * + *
+   * Output only. Timestamp when the folder was requested to be deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getDeleteTime() { + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; + } + /** + * + * + *
+   * Output only. Timestamp when the folder was requested to be deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + return getDeleteTime(); + } + + public static final int ETAG_FIELD_NUMBER = 8; + private volatile java.lang.Object 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.
+   * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * 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.
+   * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, parent_); + } + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, displayName_); + } + if (state_ != com.google.cloud.resourcemanager.v3.Folder.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, state_); + } + if (createTime_ != null) { + output.writeMessage(5, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(6, getUpdateTime()); + } + if (deleteTime_ != null) { + output.writeMessage(7, getDeleteTime()); + } + if (!getEtagBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, etag_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, parent_); + } + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, displayName_); + } + if (state_ != com.google.cloud.resourcemanager.v3.Folder.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, state_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getUpdateTime()); + } + if (deleteTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getDeleteTime()); + } + if (!getEtagBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, etag_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.Folder)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.Folder other = + (com.google.cloud.resourcemanager.v3.Folder) obj; + + if (!getName().equals(other.getName())) return false; + if (!getParent().equals(other.getParent())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (state_ != other.state_) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasDeleteTime() != other.hasDeleteTime()) return false; + if (hasDeleteTime()) { + if (!getDeleteTime().equals(other.getDeleteTime())) return false; + } + if (!getEtag().equals(other.getEtag())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasDeleteTime()) { + hash = (37 * hash) + DELETE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDeleteTime().hashCode(); + } + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.Folder parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.Folder parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.Folder parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.Folder parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.Folder parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.Folder parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.Folder parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.Folder parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.Folder parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.Folder parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.Folder parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.Folder parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.resourcemanager.v3.Folder prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A folder in an organization's resource hierarchy, used to
+   * organize that organization's resources.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.Folder} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.Folder) + com.google.cloud.resourcemanager.v3.FolderOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_Folder_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_Folder_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.Folder.class, + com.google.cloud.resourcemanager.v3.Folder.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.Folder.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + parent_ = ""; + + displayName_ = ""; + + state_ = 0; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + if (deleteTimeBuilder_ == null) { + deleteTime_ = null; + } else { + deleteTime_ = null; + deleteTimeBuilder_ = null; + } + etag_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_Folder_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Folder getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.Folder.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Folder build() { + com.google.cloud.resourcemanager.v3.Folder result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Folder buildPartial() { + com.google.cloud.resourcemanager.v3.Folder result = + new com.google.cloud.resourcemanager.v3.Folder(this); + result.name_ = name_; + result.parent_ = parent_; + result.displayName_ = displayName_; + result.state_ = state_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + if (deleteTimeBuilder_ == null) { + result.deleteTime_ = deleteTime_; + } else { + result.deleteTime_ = deleteTimeBuilder_.build(); + } + result.etag_ = etag_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.Folder) { + return mergeFrom((com.google.cloud.resourcemanager.v3.Folder) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.Folder other) { + if (other == com.google.cloud.resourcemanager.v3.Folder.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasDeleteTime()) { + mergeDeleteTime(other.getDeleteTime()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.Folder parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.resourcemanager.v3.Folder) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The resource name of the folder.
+     * Its format is `folders/{folder_id}`, for example: "folders/1234".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the folder.
+     * Its format is `folders/{folder_id}`, for example: "folders/1234".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the folder.
+     * Its format is `folders/{folder_id}`, for example: "folders/1234".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the folder.
+     * Its format is `folders/{folder_id}`, for example: "folders/1234".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the folder.
+     * Its format is `folders/{folder_id}`, for example: "folders/1234".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object 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].
+     * 
+ * + * string parent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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].
+     * 
+ * + * string parent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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].
+     * 
+ * + * string parent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + 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].
+     * 
+ * + * string parent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + 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].
+     * 
+ * + * string parent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * 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}])?`.
+     * 
+ * + * string display_name = 3; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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}])?`.
+     * 
+ * + * string display_name = 3; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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}])?`.
+     * 
+ * + * string display_name = 3; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + 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}])?`.
+     * 
+ * + * string display_name = 3; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + 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}])?`.
+     * 
+ * + * string display_name = 3; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * 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].
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return 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].
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + 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].
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Folder.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.resourcemanager.v3.Folder.State result = + com.google.cloud.resourcemanager.v3.Folder.State.valueOf(state_); + return result == null + ? com.google.cloud.resourcemanager.v3.Folder.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * 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].
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.resourcemanager.v3.Folder.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + 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].
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Timestamp when the folder was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. Timestamp when the folder was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Timestamp when the folder was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the folder was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the folder was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the folder was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the folder was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Timestamp when the folder was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Timestamp when the folder was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Timestamp when the folder was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. Timestamp when the folder was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Timestamp when the folder was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the folder was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the folder was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the folder was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the folder was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Timestamp when the folder was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Timestamp when the folder was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.Timestamp deleteTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + deleteTimeBuilder_; + /** + * + * + *
+     * Output only. Timestamp when the folder was requested to be deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + public boolean hasDeleteTime() { + return deleteTimeBuilder_ != null || deleteTime_ != null; + } + /** + * + * + *
+     * Output only. Timestamp when the folder was requested to be deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + public com.google.protobuf.Timestamp getDeleteTime() { + if (deleteTimeBuilder_ == null) { + return deleteTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deleteTime_; + } else { + return deleteTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Timestamp when the folder was requested to be deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deleteTime_ = value; + onChanged(); + } else { + deleteTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the folder was requested to be deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (deleteTimeBuilder_ == null) { + deleteTime_ = builderForValue.build(); + onChanged(); + } else { + deleteTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the folder was requested to be deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (deleteTime_ != null) { + deleteTime_ = + com.google.protobuf.Timestamp.newBuilder(deleteTime_).mergeFrom(value).buildPartial(); + } else { + deleteTime_ = value; + } + onChanged(); + } else { + deleteTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the folder was requested to be deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDeleteTime() { + if (deleteTimeBuilder_ == null) { + deleteTime_ = null; + onChanged(); + } else { + deleteTime_ = null; + deleteTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the folder was requested to be deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() { + + onChanged(); + return getDeleteTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Timestamp when the folder was requested to be deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + if (deleteTimeBuilder_ != null) { + return deleteTimeBuilder_.getMessageOrBuilder(); + } else { + return deleteTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deleteTime_; + } + } + /** + * + * + *
+     * Output only. Timestamp when the folder was requested to be deleted.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getDeleteTimeFieldBuilder() { + if (deleteTimeBuilder_ == null) { + deleteTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getDeleteTime(), getParentForChildren(), isClean()); + deleteTime_ = null; + } + return deleteTimeBuilder_; + } + + private java.lang.Object 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.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + etag_ = value; + onChanged(); + 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.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + + etag_ = getDefaultInstance().getEtag(); + onChanged(); + 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.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + etag_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.Folder) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.Folder) + private static final com.google.cloud.resourcemanager.v3.Folder DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.Folder(); + } + + public static com.google.cloud.resourcemanager.v3.Folder getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Folder parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Folder(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Folder getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/FolderName.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/FolderName.java new file mode 100644 index 000000000000..120c0022d4cd --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/FolderName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class FolderName implements ResourceName { + private static final PathTemplate FOLDER = + PathTemplate.createWithoutUrlEncoding("folders/{folder}"); + private volatile Map fieldValuesMap; + private final String folder; + + @Deprecated + protected FolderName() { + folder = null; + } + + private FolderName(Builder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + } + + public String getFolder() { + return folder; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static FolderName of(String folder) { + return newBuilder().setFolder(folder).build(); + } + + public static String format(String folder) { + return newBuilder().setFolder(folder).build().toString(); + } + + public static FolderName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + FOLDER.validatedMatch( + formattedString, "FolderName.parse: formattedString not in valid format"); + return of(matchMap.get("folder")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (FolderName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return FOLDER.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return FOLDER.instantiate("folder", folder); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + FolderName that = ((FolderName) o); + return Objects.equals(this.folder, that.folder); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(folder); + return h; + } + + /** Builder for folders/{folder}. */ + public static class Builder { + private String folder; + + protected Builder() {} + + public String getFolder() { + return folder; + } + + public Builder setFolder(String folder) { + this.folder = folder; + return this; + } + + private Builder(FolderName folderName) { + folder = folderName.folder; + } + + public FolderName build() { + return new FolderName(this); + } + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/FolderOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/FolderOrBuilder.java new file mode 100644 index 000000000000..65e3b2176894 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/FolderOrBuilder.java @@ -0,0 +1,296 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +public interface FolderOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.Folder) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The resource name of the folder.
+   * Its format is `folders/{folder_id}`, for example: "folders/1234".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The resource name of the folder.
+   * Its format is `folders/{folder_id}`, for example: "folders/1234".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * 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].
+   * 
+ * + * string parent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * 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].
+   * 
+ * + * string parent = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * 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}])?`.
+   * 
+ * + * string display_name = 3; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * 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}])?`.
+   * 
+ * + * string display_name = 3; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * 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].
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * 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].
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.resourcemanager.v3.Folder.State getState(); + + /** + * + * + *
+   * Output only. Timestamp when the folder was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Timestamp when the folder was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Timestamp when the folder was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Timestamp when the folder was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Timestamp when the folder was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Timestamp when the folder was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Timestamp when the folder was requested to be deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + boolean hasDeleteTime(); + /** + * + * + *
+   * Output only. Timestamp when the folder was requested to be deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + com.google.protobuf.Timestamp getDeleteTime(); + /** + * + * + *
+   * Output only. Timestamp when the folder was requested to be deleted.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * 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.
+   * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/FoldersProto.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/FoldersProto.java new file mode 100644 index 000000000000..7e5c741930e8 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/FoldersProto.java @@ -0,0 +1,380 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +public final class FoldersProto { + private FoldersProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_Folder_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_Folder_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_GetFolderRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_GetFolderRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_ListFoldersRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_ListFoldersRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_ListFoldersResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_ListFoldersResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_SearchFoldersRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_SearchFoldersRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_SearchFoldersResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_SearchFoldersResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_CreateFolderRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_CreateFolderRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_CreateFolderMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_CreateFolderMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_UpdateFolderRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_UpdateFolderRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_UpdateFolderMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_UpdateFolderMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_MoveFolderRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_MoveFolderRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_MoveFolderMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_MoveFolderMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_DeleteFolderRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_DeleteFolderRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_DeleteFolderMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_DeleteFolderMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_UndeleteFolderRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_UndeleteFolderRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_UndeleteFolderMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_UndeleteFolderMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n-google/cloud/resourcemanager/v3/folder" + + "s.proto\022\037google.cloud.resourcemanager.v3" + + "\032\034google/api/annotations.proto\032\027google/a" + + "pi/client.proto\032\037google/api/field_behavi" + + "or.proto\032\031google/api/resource.proto\032\036goo" + + "gle/iam/v1/iam_policy.proto\032\032google/iam/" + + "v1/policy.proto\032#google/longrunning/oper" + + "ations.proto\032 google/protobuf/field_mask" + + ".proto\032\037google/protobuf/timestamp.proto\"" + + "\306\003\n\006Folder\022\021\n\004name\030\001 \001(\tB\003\340A\003\022\023\n\006parent\030" + + "\002 \001(\tB\003\340A\002\022\024\n\014display_name\030\003 \001(\t\022A\n\005stat" + + "e\030\004 \001(\0162-.google.cloud.resourcemanager.v" + + "3.Folder.StateB\003\340A\003\0224\n\013create_time\030\005 \001(\013" + + "2\032.google.protobuf.TimestampB\003\340A\003\0224\n\013upd" + + "ate_time\030\006 \001(\0132\032.google.protobuf.Timesta" + + "mpB\003\340A\003\0224\n\013delete_time\030\007 \001(\0132\032.google.pr" + + "otobuf.TimestampB\003\340A\003\022\021\n\004etag\030\010 \001(\tB\003\340A\003" + + "\"@\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\n\n\006ACTI" + + "VE\020\001\022\024\n\020DELETE_REQUESTED\020\002:D\352AA\n*cloudre" + + "sourcemanager.googleapis.com/Folder\022\020fol" + + "ders/{folder}R\001\001\"T\n\020GetFolderRequest\022@\n\004" + + "name\030\001 \001(\tB2\340A\002\372A,\n*cloudresourcemanager" + + ".googleapis.com/Folder\"{\n\022ListFoldersReq" + + "uest\022\031\n\006parent\030\001 \001(\tB\t\340A\002\372A\003\022\001*\022\026\n\tpage_" + + "size\030\002 \001(\005B\003\340A\001\022\027\n\npage_token\030\003 \001(\tB\003\340A\001" + + "\022\031\n\014show_deleted\030\004 \001(\010B\003\340A\001\"h\n\023ListFolde" + + "rsResponse\0228\n\007folders\030\001 \003(\0132\'.google.clo" + + "ud.resourcemanager.v3.Folder\022\027\n\017next_pag" + + "e_token\030\002 \001(\t\"[\n\024SearchFoldersRequest\022\026\n" + + "\tpage_size\030\001 \001(\005B\003\340A\001\022\027\n\npage_token\030\002 \001(" + + "\tB\003\340A\001\022\022\n\005query\030\003 \001(\tB\003\340A\001\"j\n\025SearchFold" + + "ersResponse\0228\n\007folders\030\001 \003(\0132\'.google.cl" + + "oud.resourcemanager.v3.Folder\022\027\n\017next_pa" + + "ge_token\030\002 \001(\t\"S\n\023CreateFolderRequest\022<\n" + + "\006folder\030\002 \001(\0132\'.google.cloud.resourceman" + + "ager.v3.FolderB\003\340A\002\"<\n\024CreateFolderMetad" + + "ata\022\024\n\014display_name\030\001 \001(\t\022\016\n\006parent\030\002 \001(" + + "\t\"\211\001\n\023UpdateFolderRequest\022<\n\006folder\030\001 \001(" + + "\0132\'.google.cloud.resourcemanager.v3.Fold" + + "erB\003\340A\002\0224\n\013update_mask\030\002 \001(\0132\032.google.pr" + + "otobuf.FieldMaskB\003\340A\002\"\026\n\024UpdateFolderMet" + + "adata\"|\n\021MoveFolderRequest\022@\n\004name\030\001 \001(\t" + + "B2\340A\002\372A,\n*cloudresourcemanager.googleapi" + + "s.com/Folder\022%\n\022destination_parent\030\002 \001(\t" + + "B\t\340A\002\372A\003\022\001*\"]\n\022MoveFolderMetadata\022\024\n\014dis" + + "play_name\030\001 \001(\t\022\025\n\rsource_parent\030\002 \001(\t\022\032" + + "\n\022destination_parent\030\003 \001(\t\"W\n\023DeleteFold" + + "erRequest\022@\n\004name\030\001 \001(\tB2\340A\002\372A,\n*cloudre" + + "sourcemanager.googleapis.com/Folder\"\026\n\024D" + + "eleteFolderMetadata\"Y\n\025UndeleteFolderReq" + + "uest\022@\n\004name\030\001 \001(\tB2\340A\002\372A,\n*cloudresourc" + + "emanager.googleapis.com/Folder\"\030\n\026Undele" + + "teFolderMetadata2\336\017\n\007Folders\022\214\001\n\tGetFold" + + "er\0221.google.cloud.resourcemanager.v3.Get" + + "FolderRequest\032\'.google.cloud.resourceman" + + "ager.v3.Folder\"#\202\323\344\223\002\026\022\024/v3/{name=folder" + + "s/*}\332A\004name\022\226\001\n\013ListFolders\0223.google.clo" + + "ud.resourcemanager.v3.ListFoldersRequest" + + "\0324.google.cloud.resourcemanager.v3.ListF" + + "oldersResponse\"\034\202\323\344\223\002\r\022\013/v3/folders\332A\006pa" + + "rent\022\242\001\n\rSearchFolders\0225.google.cloud.re" + + "sourcemanager.v3.SearchFoldersRequest\0326." + + "google.cloud.resourcemanager.v3.SearchFo" + + "ldersResponse\"\"\202\323\344\223\002\024\022\022/v3/folders:searc" + + "h\332A\005query\022\252\001\n\014CreateFolder\0224.google.clou" + + "d.resourcemanager.v3.CreateFolderRequest" + + "\032\035.google.longrunning.Operation\"E\202\323\344\223\002\025\"" + + "\013/v3/folders:\006folder\332A\006folder\312A\036\n\006Folder" + + "\022\024CreateFolderMetadata\022\306\001\n\014UpdateFolder\022" + + "4.google.cloud.resourcemanager.v3.Update" + + "FolderRequest\032\035.google.longrunning.Opera" + + "tion\"a\202\323\344\223\002%2\033/v3/{folder.name=folders/*" + + "}:\006folder\332A\022folder,update_mask\312A\036\n\006Folde" + + "r\022\024UpdateFolderMetadata\022\276\001\n\nMoveFolder\0222" + + ".google.cloud.resourcemanager.v3.MoveFol" + + "derRequest\032\035.google.longrunning.Operatio" + + "n\"]\202\323\344\223\002\036\"\031/v3/{name=folders/*}:move:\001*\332" + + "A\027name,destination_parent\312A\034\n\006Folder\022\022Mo" + + "veFolderMetadata\022\251\001\n\014DeleteFolder\0224.goog" + + "le.cloud.resourcemanager.v3.DeleteFolder" + + "Request\032\035.google.longrunning.Operation\"D" + + "\202\323\344\223\002\026*\024/v3/{name=folders/*}\332A\004name\312A\036\n\006" + + "Folder\022\024DeleteFolderMetadata\022\273\001\n\016Undelet" + + "eFolder\0226.google.cloud.resourcemanager.v" + + "3.UndeleteFolderRequest\032\035.google.longrun" + + "ning.Operation\"R\202\323\344\223\002\"\"\035/v3/{name=folder" + + "s/*}:undelete:\001*\332A\004name\312A \n\006Folder\022\026Unde" + + "leteFolderMetadata\022\206\001\n\014GetIamPolicy\022\".go" + + "ogle.iam.v1.GetIamPolicyRequest\032\025.google" + + ".iam.v1.Policy\";\202\323\344\223\002*\"%/v3/{resource=fo" + + "lders/*}:getIamPolicy:\001*\332A\010resource\022\215\001\n\014" + + "SetIamPolicy\022\".google.iam.v1.SetIamPolic" + + "yRequest\032\025.google.iam.v1.Policy\"B\202\323\344\223\002*\"" + + "%/v3/{resource=folders/*}:setIamPolicy:\001" + + "*\332A\017resource,policy\022\270\001\n\022TestIamPermissio" + + "ns\022(.google.iam.v1.TestIamPermissionsReq" + + "uest\032).google.iam.v1.TestIamPermissionsR" + + "esponse\"M\202\323\344\223\0020\"+/v3/{resource=folders/*" + + "}:testIamPermissions:\001*\332A\024resource,permi" + + "ssions\032\220\001\312A#cloudresourcemanager.googlea" + + "pis.com\322Aghttps://www.googleapis.com/aut" + + "h/cloud-platform,https://www.googleapis." + + "com/auth/cloud-platform.read-onlyB\311\001\n#co" + + "m.google.cloud.resourcemanager.v3B\014Folde" + + "rsProtoP\001ZNgoogle.golang.org/genproto/go" + + "ogleapis/cloud/resourcemanager/v3;resour" + + "cemanager\252\002\037Google.Cloud.ResourceManager" + + ".V3\312\002\037Google\\Cloud\\ResourceManager\\V3b\006p" + + "roto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.iam.v1.IamPolicyProto.getDescriptor(), + com.google.iam.v1.PolicyProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_resourcemanager_v3_Folder_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_resourcemanager_v3_Folder_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_Folder_descriptor, + new java.lang.String[] { + "Name", + "Parent", + "DisplayName", + "State", + "CreateTime", + "UpdateTime", + "DeleteTime", + "Etag", + }); + internal_static_google_cloud_resourcemanager_v3_GetFolderRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_resourcemanager_v3_GetFolderRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_GetFolderRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_resourcemanager_v3_ListFoldersRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_resourcemanager_v3_ListFoldersRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_ListFoldersRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "ShowDeleted", + }); + internal_static_google_cloud_resourcemanager_v3_ListFoldersResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_resourcemanager_v3_ListFoldersResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_ListFoldersResponse_descriptor, + new java.lang.String[] { + "Folders", "NextPageToken", + }); + internal_static_google_cloud_resourcemanager_v3_SearchFoldersRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_resourcemanager_v3_SearchFoldersRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_SearchFoldersRequest_descriptor, + new java.lang.String[] { + "PageSize", "PageToken", "Query", + }); + internal_static_google_cloud_resourcemanager_v3_SearchFoldersResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_resourcemanager_v3_SearchFoldersResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_SearchFoldersResponse_descriptor, + new java.lang.String[] { + "Folders", "NextPageToken", + }); + internal_static_google_cloud_resourcemanager_v3_CreateFolderRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_resourcemanager_v3_CreateFolderRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_CreateFolderRequest_descriptor, + new java.lang.String[] { + "Folder", + }); + internal_static_google_cloud_resourcemanager_v3_CreateFolderMetadata_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_resourcemanager_v3_CreateFolderMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_CreateFolderMetadata_descriptor, + new java.lang.String[] { + "DisplayName", "Parent", + }); + internal_static_google_cloud_resourcemanager_v3_UpdateFolderRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_resourcemanager_v3_UpdateFolderRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_UpdateFolderRequest_descriptor, + new java.lang.String[] { + "Folder", "UpdateMask", + }); + internal_static_google_cloud_resourcemanager_v3_UpdateFolderMetadata_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_resourcemanager_v3_UpdateFolderMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_UpdateFolderMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_resourcemanager_v3_MoveFolderRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_resourcemanager_v3_MoveFolderRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_MoveFolderRequest_descriptor, + new java.lang.String[] { + "Name", "DestinationParent", + }); + internal_static_google_cloud_resourcemanager_v3_MoveFolderMetadata_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_resourcemanager_v3_MoveFolderMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_MoveFolderMetadata_descriptor, + new java.lang.String[] { + "DisplayName", "SourceParent", "DestinationParent", + }); + internal_static_google_cloud_resourcemanager_v3_DeleteFolderRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_resourcemanager_v3_DeleteFolderRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_DeleteFolderRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_resourcemanager_v3_DeleteFolderMetadata_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_resourcemanager_v3_DeleteFolderMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_DeleteFolderMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_resourcemanager_v3_UndeleteFolderRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_resourcemanager_v3_UndeleteFolderRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_UndeleteFolderRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_resourcemanager_v3_UndeleteFolderMetadata_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_resourcemanager_v3_UndeleteFolderMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_UndeleteFolderMetadata_descriptor, + new java.lang.String[] {}); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.iam.v1.IamPolicyProto.getDescriptor(); + com.google.iam.v1.PolicyProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetFolderRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetFolderRequest.java new file mode 100644 index 000000000000..4c9321d28819 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetFolderRequest.java @@ -0,0 +1,657 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The GetFolder request message.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.GetFolderRequest} + */ +public final class GetFolderRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.GetFolderRequest) + GetFolderRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetFolderRequest.newBuilder() to construct. + private GetFolderRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetFolderRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetFolderRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetFolderRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_GetFolderRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_GetFolderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.GetFolderRequest.class, + com.google.cloud.resourcemanager.v3.GetFolderRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the folder to retrieve.
+   * Must be of the form `folders/{folder_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the folder to retrieve.
+   * Must be of the form `folders/{folder_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.GetFolderRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.GetFolderRequest other = + (com.google.cloud.resourcemanager.v3.GetFolderRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.GetFolderRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.GetFolderRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.GetFolderRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.GetFolderRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.GetFolderRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.GetFolderRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.GetFolderRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.GetFolderRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.GetFolderRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.GetFolderRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.GetFolderRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.GetFolderRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.resourcemanager.v3.GetFolderRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The GetFolder request message.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.GetFolderRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.GetFolderRequest) + com.google.cloud.resourcemanager.v3.GetFolderRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_GetFolderRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_GetFolderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.GetFolderRequest.class, + com.google.cloud.resourcemanager.v3.GetFolderRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.GetFolderRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_GetFolderRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.GetFolderRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.GetFolderRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.GetFolderRequest build() { + com.google.cloud.resourcemanager.v3.GetFolderRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.GetFolderRequest buildPartial() { + com.google.cloud.resourcemanager.v3.GetFolderRequest result = + new com.google.cloud.resourcemanager.v3.GetFolderRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.GetFolderRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.GetFolderRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.GetFolderRequest other) { + if (other == com.google.cloud.resourcemanager.v3.GetFolderRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.GetFolderRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.GetFolderRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the folder to retrieve.
+     * Must be of the form `folders/{folder_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the folder to retrieve.
+     * Must be of the form `folders/{folder_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the folder to retrieve.
+     * Must be of the form `folders/{folder_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the folder to retrieve.
+     * Must be of the form `folders/{folder_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the folder to retrieve.
+     * Must be of the form `folders/{folder_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.GetFolderRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.GetFolderRequest) + private static final com.google.cloud.resourcemanager.v3.GetFolderRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.GetFolderRequest(); + } + + public static com.google.cloud.resourcemanager.v3.GetFolderRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetFolderRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetFolderRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.GetFolderRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetFolderRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetFolderRequestOrBuilder.java new file mode 100644 index 000000000000..694273092111 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetFolderRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +public interface GetFolderRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.GetFolderRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the folder to retrieve.
+   * Must be of the form `folders/{folder_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the folder to retrieve.
+   * Must be of the form `folders/{folder_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetOrganizationRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetOrganizationRequest.java new file mode 100644 index 000000000000..e65a180b71a1 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetOrganizationRequest.java @@ -0,0 +1,667 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/organizations.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The request sent to the `GetOrganization` method. The `name` field is
+ * required. `organization_id` is no longer accepted.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.GetOrganizationRequest} + */ +public final class GetOrganizationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.GetOrganizationRequest) + GetOrganizationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetOrganizationRequest.newBuilder() to construct. + private GetOrganizationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetOrganizationRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetOrganizationRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetOrganizationRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_GetOrganizationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_GetOrganizationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.GetOrganizationRequest.class, + com.google.cloud.resourcemanager.v3.GetOrganizationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object 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".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * 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".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.GetOrganizationRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.GetOrganizationRequest other = + (com.google.cloud.resourcemanager.v3.GetOrganizationRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.GetOrganizationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.GetOrganizationRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.GetOrganizationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.GetOrganizationRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.GetOrganizationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.GetOrganizationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.GetOrganizationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.GetOrganizationRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.GetOrganizationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.GetOrganizationRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.GetOrganizationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.GetOrganizationRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.GetOrganizationRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request sent to the `GetOrganization` method. The `name` field is
+   * required. `organization_id` is no longer accepted.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.GetOrganizationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.GetOrganizationRequest) + com.google.cloud.resourcemanager.v3.GetOrganizationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_GetOrganizationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_GetOrganizationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.GetOrganizationRequest.class, + com.google.cloud.resourcemanager.v3.GetOrganizationRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.GetOrganizationRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_GetOrganizationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.GetOrganizationRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.GetOrganizationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.GetOrganizationRequest build() { + com.google.cloud.resourcemanager.v3.GetOrganizationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.GetOrganizationRequest buildPartial() { + com.google.cloud.resourcemanager.v3.GetOrganizationRequest result = + new com.google.cloud.resourcemanager.v3.GetOrganizationRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.GetOrganizationRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.GetOrganizationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.GetOrganizationRequest other) { + if (other == com.google.cloud.resourcemanager.v3.GetOrganizationRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.GetOrganizationRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.GetOrganizationRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object 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".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.GetOrganizationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.GetOrganizationRequest) + private static final com.google.cloud.resourcemanager.v3.GetOrganizationRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.GetOrganizationRequest(); + } + + public static com.google.cloud.resourcemanager.v3.GetOrganizationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetOrganizationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetOrganizationRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.GetOrganizationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetOrganizationRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetOrganizationRequestOrBuilder.java new file mode 100644 index 000000000000..1d9df446511a --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetOrganizationRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/organizations.proto + +package com.google.cloud.resourcemanager.v3; + +public interface GetOrganizationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.GetOrganizationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * 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".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetProjectRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetProjectRequest.java new file mode 100644 index 000000000000..b3d8ba65cb4c --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetProjectRequest.java @@ -0,0 +1,655 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The request sent to the
+ * [GetProject][google.cloud.resourcemanager.v3.Projects.GetProject]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.GetProjectRequest} + */ +public final class GetProjectRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.GetProjectRequest) + GetProjectRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetProjectRequest.newBuilder() to construct. + private GetProjectRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetProjectRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetProjectRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetProjectRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_GetProjectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_GetProjectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.GetProjectRequest.class, + com.google.cloud.resourcemanager.v3.GetProjectRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the project (for example, `projects/415104041262`).
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the project (for example, `projects/415104041262`).
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.GetProjectRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.GetProjectRequest other = + (com.google.cloud.resourcemanager.v3.GetProjectRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.GetProjectRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.GetProjectRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.GetProjectRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.GetProjectRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.GetProjectRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.GetProjectRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.GetProjectRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.GetProjectRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.GetProjectRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.GetProjectRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.GetProjectRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.GetProjectRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.GetProjectRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request sent to the
+   * [GetProject][google.cloud.resourcemanager.v3.Projects.GetProject]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.GetProjectRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.GetProjectRequest) + com.google.cloud.resourcemanager.v3.GetProjectRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_GetProjectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_GetProjectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.GetProjectRequest.class, + com.google.cloud.resourcemanager.v3.GetProjectRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.GetProjectRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_GetProjectRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.GetProjectRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.GetProjectRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.GetProjectRequest build() { + com.google.cloud.resourcemanager.v3.GetProjectRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.GetProjectRequest buildPartial() { + com.google.cloud.resourcemanager.v3.GetProjectRequest result = + new com.google.cloud.resourcemanager.v3.GetProjectRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.GetProjectRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.GetProjectRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.GetProjectRequest other) { + if (other == com.google.cloud.resourcemanager.v3.GetProjectRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.GetProjectRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.GetProjectRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the project (for example, `projects/415104041262`).
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the project (for example, `projects/415104041262`).
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the project (for example, `projects/415104041262`).
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the project (for example, `projects/415104041262`).
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the project (for example, `projects/415104041262`).
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.GetProjectRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.GetProjectRequest) + private static final com.google.cloud.resourcemanager.v3.GetProjectRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.GetProjectRequest(); + } + + public static com.google.cloud.resourcemanager.v3.GetProjectRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetProjectRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetProjectRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.GetProjectRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetProjectRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetProjectRequestOrBuilder.java new file mode 100644 index 000000000000..4183ec3d94d0 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetProjectRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +public interface GetProjectRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.GetProjectRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the project (for example, `projects/415104041262`).
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the project (for example, `projects/415104041262`).
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetTagKeyRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetTagKeyRequest.java new file mode 100644 index 000000000000..23759b320429 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetTagKeyRequest.java @@ -0,0 +1,657 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_keys.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The request message for getting a TagKey.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.GetTagKeyRequest} + */ +public final class GetTagKeyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.GetTagKeyRequest) + GetTagKeyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetTagKeyRequest.newBuilder() to construct. + private GetTagKeyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetTagKeyRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetTagKeyRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetTagKeyRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_GetTagKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_GetTagKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.GetTagKeyRequest.class, + com.google.cloud.resourcemanager.v3.GetTagKeyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. A resource name in the format `tagKeys/{id}`, such as
+   * `tagKeys/123`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. A resource name in the format `tagKeys/{id}`, such as
+   * `tagKeys/123`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.GetTagKeyRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.GetTagKeyRequest other = + (com.google.cloud.resourcemanager.v3.GetTagKeyRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.GetTagKeyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.GetTagKeyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.GetTagKeyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.GetTagKeyRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.GetTagKeyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.GetTagKeyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.GetTagKeyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.GetTagKeyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.GetTagKeyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.GetTagKeyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.GetTagKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.GetTagKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.resourcemanager.v3.GetTagKeyRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for getting a TagKey.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.GetTagKeyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.GetTagKeyRequest) + com.google.cloud.resourcemanager.v3.GetTagKeyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_GetTagKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_GetTagKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.GetTagKeyRequest.class, + com.google.cloud.resourcemanager.v3.GetTagKeyRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.GetTagKeyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_GetTagKeyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.GetTagKeyRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.GetTagKeyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.GetTagKeyRequest build() { + com.google.cloud.resourcemanager.v3.GetTagKeyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.GetTagKeyRequest buildPartial() { + com.google.cloud.resourcemanager.v3.GetTagKeyRequest result = + new com.google.cloud.resourcemanager.v3.GetTagKeyRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.GetTagKeyRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.GetTagKeyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.GetTagKeyRequest other) { + if (other == com.google.cloud.resourcemanager.v3.GetTagKeyRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.GetTagKeyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.GetTagKeyRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. A resource name in the format `tagKeys/{id}`, such as
+     * `tagKeys/123`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. A resource name in the format `tagKeys/{id}`, such as
+     * `tagKeys/123`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. A resource name in the format `tagKeys/{id}`, such as
+     * `tagKeys/123`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A resource name in the format `tagKeys/{id}`, such as
+     * `tagKeys/123`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A resource name in the format `tagKeys/{id}`, such as
+     * `tagKeys/123`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.GetTagKeyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.GetTagKeyRequest) + private static final com.google.cloud.resourcemanager.v3.GetTagKeyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.GetTagKeyRequest(); + } + + public static com.google.cloud.resourcemanager.v3.GetTagKeyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetTagKeyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetTagKeyRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.GetTagKeyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetTagKeyRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetTagKeyRequestOrBuilder.java new file mode 100644 index 000000000000..9caeee7b1509 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetTagKeyRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_keys.proto + +package com.google.cloud.resourcemanager.v3; + +public interface GetTagKeyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.GetTagKeyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. A resource name in the format `tagKeys/{id}`, such as
+   * `tagKeys/123`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. A resource name in the format `tagKeys/{id}`, such as
+   * `tagKeys/123`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetTagValueRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetTagValueRequest.java new file mode 100644 index 000000000000..fcb19f7148d1 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetTagValueRequest.java @@ -0,0 +1,651 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_values.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The request message for getting a TagValue.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.GetTagValueRequest} + */ +public final class GetTagValueRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.GetTagValueRequest) + GetTagValueRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetTagValueRequest.newBuilder() to construct. + private GetTagValueRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetTagValueRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetTagValueRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetTagValueRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_GetTagValueRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_GetTagValueRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.GetTagValueRequest.class, + com.google.cloud.resourcemanager.v3.GetTagValueRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Resource name for TagValue to be fetched in the format `tagValues/456`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Resource name for TagValue to be fetched in the format `tagValues/456`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.GetTagValueRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.GetTagValueRequest other = + (com.google.cloud.resourcemanager.v3.GetTagValueRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.GetTagValueRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.GetTagValueRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.GetTagValueRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.GetTagValueRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.GetTagValueRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.GetTagValueRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.GetTagValueRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.GetTagValueRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.GetTagValueRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.GetTagValueRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.GetTagValueRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.GetTagValueRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.GetTagValueRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for getting a TagValue.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.GetTagValueRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.GetTagValueRequest) + com.google.cloud.resourcemanager.v3.GetTagValueRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_GetTagValueRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_GetTagValueRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.GetTagValueRequest.class, + com.google.cloud.resourcemanager.v3.GetTagValueRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.GetTagValueRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_GetTagValueRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.GetTagValueRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.GetTagValueRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.GetTagValueRequest build() { + com.google.cloud.resourcemanager.v3.GetTagValueRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.GetTagValueRequest buildPartial() { + com.google.cloud.resourcemanager.v3.GetTagValueRequest result = + new com.google.cloud.resourcemanager.v3.GetTagValueRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.GetTagValueRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.GetTagValueRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.GetTagValueRequest other) { + if (other == com.google.cloud.resourcemanager.v3.GetTagValueRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.GetTagValueRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.GetTagValueRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Resource name for TagValue to be fetched in the format `tagValues/456`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Resource name for TagValue to be fetched in the format `tagValues/456`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Resource name for TagValue to be fetched in the format `tagValues/456`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name for TagValue to be fetched in the format `tagValues/456`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name for TagValue to be fetched in the format `tagValues/456`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.GetTagValueRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.GetTagValueRequest) + private static final com.google.cloud.resourcemanager.v3.GetTagValueRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.GetTagValueRequest(); + } + + public static com.google.cloud.resourcemanager.v3.GetTagValueRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetTagValueRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetTagValueRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.GetTagValueRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetTagValueRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetTagValueRequestOrBuilder.java new file mode 100644 index 000000000000..227b62db4c47 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/GetTagValueRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_values.proto + +package com.google.cloud.resourcemanager.v3; + +public interface GetTagValueRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.GetTagValueRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Resource name for TagValue to be fetched in the format `tagValues/456`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Resource name for TagValue to be fetched in the format `tagValues/456`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListFoldersRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListFoldersRequest.java new file mode 100644 index 000000000000..0a301c0016ba --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListFoldersRequest.java @@ -0,0 +1,1057 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The ListFolders request message.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.ListFoldersRequest} + */ +public final class ListFoldersRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.ListFoldersRequest) + ListFoldersRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFoldersRequest.newBuilder() to construct. + private ListFoldersRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListFoldersRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListFoldersRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListFoldersRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 32: + { + showDeleted_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_ListFoldersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_ListFoldersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.ListFoldersRequest.class, + com.google.cloud.resourcemanager.v3.ListFoldersRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The resource name of the organization or folder whose folders are
+   * being listed.
+   * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`.
+   * Access to this method is controlled by checking the
+   * `resourcemanager.folders.list` permission on the `parent`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the organization or folder whose folders are
+   * being listed.
+   * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`.
+   * Access to this method is controlled by checking the
+   * `resourcemanager.folders.list` permission on the `parent`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * Optional. The maximum number of folders to return in the response.
+   * If unspecified, server picks an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to `ListFolders`
+   * that indicates where this listing should continue from.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to `ListFolders`
+   * that indicates where this listing should continue from.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SHOW_DELETED_FIELD_NUMBER = 4; + private boolean showDeleted_; + /** + * + * + *
+   * Optional. Controls whether folders in the
+   * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED]
+   * state should be returned. Defaults to false.
+   * 
+ * + * bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The showDeleted. + */ + @java.lang.Override + public boolean getShowDeleted() { + return showDeleted_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (showDeleted_ != false) { + output.writeBool(4, showDeleted_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (showDeleted_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, showDeleted_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.ListFoldersRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.ListFoldersRequest other = + (com.google.cloud.resourcemanager.v3.ListFoldersRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (getShowDeleted() != other.getShowDeleted()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + SHOW_DELETED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getShowDeleted()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.ListFoldersRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The ListFolders request message.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.ListFoldersRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.ListFoldersRequest) + com.google.cloud.resourcemanager.v3.ListFoldersRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_ListFoldersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_ListFoldersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.ListFoldersRequest.class, + com.google.cloud.resourcemanager.v3.ListFoldersRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.ListFoldersRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + showDeleted_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_ListFoldersRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListFoldersRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.ListFoldersRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListFoldersRequest build() { + com.google.cloud.resourcemanager.v3.ListFoldersRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListFoldersRequest buildPartial() { + com.google.cloud.resourcemanager.v3.ListFoldersRequest result = + new com.google.cloud.resourcemanager.v3.ListFoldersRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.showDeleted_ = showDeleted_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.ListFoldersRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.ListFoldersRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.ListFoldersRequest other) { + if (other == com.google.cloud.resourcemanager.v3.ListFoldersRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getShowDeleted() != false) { + setShowDeleted(other.getShowDeleted()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.ListFoldersRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.ListFoldersRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The resource name of the organization or folder whose folders are
+     * being listed.
+     * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`.
+     * Access to this method is controlled by checking the
+     * `resourcemanager.folders.list` permission on the `parent`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the organization or folder whose folders are
+     * being listed.
+     * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`.
+     * Access to this method is controlled by checking the
+     * `resourcemanager.folders.list` permission on the `parent`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the organization or folder whose folders are
+     * being listed.
+     * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`.
+     * Access to this method is controlled by checking the
+     * `resourcemanager.folders.list` permission on the `parent`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the organization or folder whose folders are
+     * being listed.
+     * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`.
+     * Access to this method is controlled by checking the
+     * `resourcemanager.folders.list` permission on the `parent`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the organization or folder whose folders are
+     * being listed.
+     * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`.
+     * Access to this method is controlled by checking the
+     * `resourcemanager.folders.list` permission on the `parent`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of folders to return in the response.
+     * If unspecified, server picks an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of folders to return in the response.
+     * If unspecified, server picks an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of folders to return in the response.
+     * If unspecified, server picks an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `ListFolders`
+     * that indicates where this listing should continue from.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `ListFolders`
+     * that indicates where this listing should continue from.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `ListFolders`
+     * that indicates where this listing should continue from.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `ListFolders`
+     * that indicates where this listing should continue from.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `ListFolders`
+     * that indicates where this listing should continue from.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private boolean showDeleted_; + /** + * + * + *
+     * Optional. Controls whether folders in the
+     * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED]
+     * state should be returned. Defaults to false.
+     * 
+ * + * bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The showDeleted. + */ + @java.lang.Override + public boolean getShowDeleted() { + return showDeleted_; + } + /** + * + * + *
+     * Optional. Controls whether folders in the
+     * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED]
+     * state should be returned. Defaults to false.
+     * 
+ * + * bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The showDeleted to set. + * @return This builder for chaining. + */ + public Builder setShowDeleted(boolean value) { + + showDeleted_ = value; + onChanged(); + 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.
+     * 
+ * + * bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearShowDeleted() { + + showDeleted_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.ListFoldersRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.ListFoldersRequest) + private static final com.google.cloud.resourcemanager.v3.ListFoldersRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.ListFoldersRequest(); + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFoldersRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListFoldersRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListFoldersRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListFoldersRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListFoldersRequestOrBuilder.java new file mode 100644 index 000000000000..81117245e27b --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListFoldersRequestOrBuilder.java @@ -0,0 +1,118 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +public interface ListFoldersRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.ListFoldersRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the organization or folder whose folders are
+   * being listed.
+   * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`.
+   * Access to this method is controlled by checking the
+   * `resourcemanager.folders.list` permission on the `parent`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource name of the organization or folder whose folders are
+   * being listed.
+   * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`.
+   * Access to this method is controlled by checking the
+   * `resourcemanager.folders.list` permission on the `parent`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The maximum number of folders to return in the response.
+   * If unspecified, server picks an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to `ListFolders`
+   * that indicates where this listing should continue from.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to `ListFolders`
+   * that indicates where this listing should continue from.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Controls whether folders in the
+   * [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED]
+   * state should be returned. Defaults to false.
+   * 
+ * + * bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The showDeleted. + */ + boolean getShowDeleted(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListFoldersResponse.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListFoldersResponse.java new file mode 100644 index 000000000000..2b142449ca5b --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListFoldersResponse.java @@ -0,0 +1,1159 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The ListFolders response message.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.ListFoldersResponse} + */ +public final class ListFoldersResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.ListFoldersResponse) + ListFoldersResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFoldersResponse.newBuilder() to construct. + private ListFoldersResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListFoldersResponse() { + folders_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListFoldersResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListFoldersResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + folders_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + folders_.add( + input.readMessage( + com.google.cloud.resourcemanager.v3.Folder.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + folders_ = java.util.Collections.unmodifiableList(folders_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_ListFoldersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_ListFoldersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.ListFoldersResponse.class, + com.google.cloud.resourcemanager.v3.ListFoldersResponse.Builder.class); + } + + public static final int FOLDERS_FIELD_NUMBER = 1; + private java.util.List folders_; + /** + * + * + *
+   * A possibly paginated list of folders that are direct descendants of
+   * the specified parent resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + @java.lang.Override + public java.util.List getFoldersList() { + return folders_; + } + /** + * + * + *
+   * A possibly paginated list of folders that are direct descendants of
+   * the specified parent resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + @java.lang.Override + public java.util.List + getFoldersOrBuilderList() { + return folders_; + } + /** + * + * + *
+   * A possibly paginated list of folders that are direct descendants of
+   * the specified parent resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + @java.lang.Override + public int getFoldersCount() { + return folders_.size(); + } + /** + * + * + *
+   * A possibly paginated list of folders that are direct descendants of
+   * the specified parent resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Folder getFolders(int index) { + return folders_.get(index); + } + /** + * + * + *
+   * A possibly paginated list of folders that are direct descendants of
+   * the specified parent resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.FolderOrBuilder getFoldersOrBuilder(int index) { + return folders_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A pagination token returned from a previous call to `ListFolders`
+   * that indicates from where listing should continue.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A pagination token returned from a previous call to `ListFolders`
+   * that indicates from where listing should continue.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < folders_.size(); i++) { + output.writeMessage(1, folders_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < folders_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, folders_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.ListFoldersResponse)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.ListFoldersResponse other = + (com.google.cloud.resourcemanager.v3.ListFoldersResponse) obj; + + if (!getFoldersList().equals(other.getFoldersList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFoldersCount() > 0) { + hash = (37 * hash) + FOLDERS_FIELD_NUMBER; + hash = (53 * hash) + getFoldersList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.ListFoldersResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The ListFolders response message.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.ListFoldersResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.ListFoldersResponse) + com.google.cloud.resourcemanager.v3.ListFoldersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_ListFoldersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_ListFoldersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.ListFoldersResponse.class, + com.google.cloud.resourcemanager.v3.ListFoldersResponse.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.ListFoldersResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFoldersFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (foldersBuilder_ == null) { + folders_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + foldersBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_ListFoldersResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListFoldersResponse getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.ListFoldersResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListFoldersResponse build() { + com.google.cloud.resourcemanager.v3.ListFoldersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListFoldersResponse buildPartial() { + com.google.cloud.resourcemanager.v3.ListFoldersResponse result = + new com.google.cloud.resourcemanager.v3.ListFoldersResponse(this); + int from_bitField0_ = bitField0_; + if (foldersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + folders_ = java.util.Collections.unmodifiableList(folders_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.folders_ = folders_; + } else { + result.folders_ = foldersBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.ListFoldersResponse) { + return mergeFrom((com.google.cloud.resourcemanager.v3.ListFoldersResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.ListFoldersResponse other) { + if (other == com.google.cloud.resourcemanager.v3.ListFoldersResponse.getDefaultInstance()) + return this; + if (foldersBuilder_ == null) { + if (!other.folders_.isEmpty()) { + if (folders_.isEmpty()) { + folders_ = other.folders_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFoldersIsMutable(); + folders_.addAll(other.folders_); + } + onChanged(); + } + } else { + if (!other.folders_.isEmpty()) { + if (foldersBuilder_.isEmpty()) { + foldersBuilder_.dispose(); + foldersBuilder_ = null; + folders_ = other.folders_; + bitField0_ = (bitField0_ & ~0x00000001); + foldersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFoldersFieldBuilder() + : null; + } else { + foldersBuilder_.addAllMessages(other.folders_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.ListFoldersResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.ListFoldersResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List folders_ = + java.util.Collections.emptyList(); + + private void ensureFoldersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + folders_ = new java.util.ArrayList(folders_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Folder, + com.google.cloud.resourcemanager.v3.Folder.Builder, + com.google.cloud.resourcemanager.v3.FolderOrBuilder> + foldersBuilder_; + + /** + * + * + *
+     * A possibly paginated list of folders that are direct descendants of
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public java.util.List getFoldersList() { + if (foldersBuilder_ == null) { + return java.util.Collections.unmodifiableList(folders_); + } else { + return foldersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A possibly paginated list of folders that are direct descendants of
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public int getFoldersCount() { + if (foldersBuilder_ == null) { + return folders_.size(); + } else { + return foldersBuilder_.getCount(); + } + } + /** + * + * + *
+     * A possibly paginated list of folders that are direct descendants of
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public com.google.cloud.resourcemanager.v3.Folder getFolders(int index) { + if (foldersBuilder_ == null) { + return folders_.get(index); + } else { + return foldersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A possibly paginated list of folders that are direct descendants of
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public Builder setFolders(int index, com.google.cloud.resourcemanager.v3.Folder value) { + if (foldersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFoldersIsMutable(); + folders_.set(index, value); + onChanged(); + } else { + foldersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of folders that are direct descendants of
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public Builder setFolders( + int index, com.google.cloud.resourcemanager.v3.Folder.Builder builderForValue) { + if (foldersBuilder_ == null) { + ensureFoldersIsMutable(); + folders_.set(index, builderForValue.build()); + onChanged(); + } else { + foldersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of folders that are direct descendants of
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public Builder addFolders(com.google.cloud.resourcemanager.v3.Folder value) { + if (foldersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFoldersIsMutable(); + folders_.add(value); + onChanged(); + } else { + foldersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of folders that are direct descendants of
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public Builder addFolders(int index, com.google.cloud.resourcemanager.v3.Folder value) { + if (foldersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFoldersIsMutable(); + folders_.add(index, value); + onChanged(); + } else { + foldersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of folders that are direct descendants of
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public Builder addFolders(com.google.cloud.resourcemanager.v3.Folder.Builder builderForValue) { + if (foldersBuilder_ == null) { + ensureFoldersIsMutable(); + folders_.add(builderForValue.build()); + onChanged(); + } else { + foldersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of folders that are direct descendants of
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public Builder addFolders( + int index, com.google.cloud.resourcemanager.v3.Folder.Builder builderForValue) { + if (foldersBuilder_ == null) { + ensureFoldersIsMutable(); + folders_.add(index, builderForValue.build()); + onChanged(); + } else { + foldersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of folders that are direct descendants of
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public Builder addAllFolders( + java.lang.Iterable values) { + if (foldersBuilder_ == null) { + ensureFoldersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, folders_); + onChanged(); + } else { + foldersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of folders that are direct descendants of
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public Builder clearFolders() { + if (foldersBuilder_ == null) { + folders_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + foldersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of folders that are direct descendants of
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public Builder removeFolders(int index) { + if (foldersBuilder_ == null) { + ensureFoldersIsMutable(); + folders_.remove(index); + onChanged(); + } else { + foldersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of folders that are direct descendants of
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public com.google.cloud.resourcemanager.v3.Folder.Builder getFoldersBuilder(int index) { + return getFoldersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A possibly paginated list of folders that are direct descendants of
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public com.google.cloud.resourcemanager.v3.FolderOrBuilder getFoldersOrBuilder(int index) { + if (foldersBuilder_ == null) { + return folders_.get(index); + } else { + return foldersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A possibly paginated list of folders that are direct descendants of
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public java.util.List + getFoldersOrBuilderList() { + if (foldersBuilder_ != null) { + return foldersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(folders_); + } + } + /** + * + * + *
+     * A possibly paginated list of folders that are direct descendants of
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public com.google.cloud.resourcemanager.v3.Folder.Builder addFoldersBuilder() { + return getFoldersFieldBuilder() + .addBuilder(com.google.cloud.resourcemanager.v3.Folder.getDefaultInstance()); + } + /** + * + * + *
+     * A possibly paginated list of folders that are direct descendants of
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public com.google.cloud.resourcemanager.v3.Folder.Builder addFoldersBuilder(int index) { + return getFoldersFieldBuilder() + .addBuilder(index, com.google.cloud.resourcemanager.v3.Folder.getDefaultInstance()); + } + /** + * + * + *
+     * A possibly paginated list of folders that are direct descendants of
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public java.util.List + getFoldersBuilderList() { + return getFoldersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Folder, + com.google.cloud.resourcemanager.v3.Folder.Builder, + com.google.cloud.resourcemanager.v3.FolderOrBuilder> + getFoldersFieldBuilder() { + if (foldersBuilder_ == null) { + foldersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Folder, + com.google.cloud.resourcemanager.v3.Folder.Builder, + com.google.cloud.resourcemanager.v3.FolderOrBuilder>( + folders_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + folders_ = null; + } + return foldersBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A pagination token returned from a previous call to `ListFolders`
+     * that indicates from where listing should continue.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A pagination token returned from a previous call to `ListFolders`
+     * that indicates from where listing should continue.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A pagination token returned from a previous call to `ListFolders`
+     * that indicates from where listing should continue.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A pagination token returned from a previous call to `ListFolders`
+     * that indicates from where listing should continue.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A pagination token returned from a previous call to `ListFolders`
+     * that indicates from where listing should continue.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.ListFoldersResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.ListFoldersResponse) + private static final com.google.cloud.resourcemanager.v3.ListFoldersResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.ListFoldersResponse(); + } + + public static com.google.cloud.resourcemanager.v3.ListFoldersResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFoldersResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListFoldersResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListFoldersResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListFoldersResponseOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListFoldersResponseOrBuilder.java new file mode 100644 index 000000000000..5e8fd2b95571 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListFoldersResponseOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +public interface ListFoldersResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.ListFoldersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A possibly paginated list of folders that are direct descendants of
+   * the specified parent resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + java.util.List getFoldersList(); + /** + * + * + *
+   * A possibly paginated list of folders that are direct descendants of
+   * the specified parent resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + com.google.cloud.resourcemanager.v3.Folder getFolders(int index); + /** + * + * + *
+   * A possibly paginated list of folders that are direct descendants of
+   * the specified parent resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + int getFoldersCount(); + /** + * + * + *
+   * A possibly paginated list of folders that are direct descendants of
+   * the specified parent resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + java.util.List + getFoldersOrBuilderList(); + /** + * + * + *
+   * A possibly paginated list of folders that are direct descendants of
+   * the specified parent resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + com.google.cloud.resourcemanager.v3.FolderOrBuilder getFoldersOrBuilder(int index); + + /** + * + * + *
+   * A pagination token returned from a previous call to `ListFolders`
+   * that indicates from where listing should continue.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A pagination token returned from a previous call to `ListFolders`
+   * that indicates from where listing should continue.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListProjectsRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListProjectsRequest.java new file mode 100644 index 000000000000..15420e276db5 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListProjectsRequest.java @@ -0,0 +1,1054 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The request sent to the
+ * [ListProjects][google.cloud.resourcemanager.v3.Projects.ListProjects]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.ListProjectsRequest} + */ +public final class ListProjectsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.ListProjectsRequest) + ListProjectsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListProjectsRequest.newBuilder() to construct. + private ListProjectsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListProjectsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListProjectsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListProjectsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 32: + { + showDeleted_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_ListProjectsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_ListProjectsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.ListProjectsRequest.class, + com.google.cloud.resourcemanager.v3.ListProjectsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The name of the parent resource to list projects under.
+   * For example, setting this field to 'folders/1234' would list all projects
+   * directly under that folder.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the parent resource to list projects under.
+   * For example, setting this field to 'folders/1234' would list all projects
+   * directly under that folder.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to [ListProjects]
+   * [google.cloud.resourcemanager.v3.Projects.ListProjects]
+   * that indicates from where listing should continue.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to [ListProjects]
+   * [google.cloud.resourcemanager.v3.Projects.ListProjects]
+   * that indicates from where listing should continue.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * 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.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int SHOW_DELETED_FIELD_NUMBER = 4; + private boolean showDeleted_; + /** + * + * + *
+   * Optional. Indicate that projects in the `DELETE_REQUESTED` state should also be
+   * returned. Normally only `ACTIVE` projects are returned.
+   * 
+ * + * bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The showDeleted. + */ + @java.lang.Override + public boolean getShowDeleted() { + return showDeleted_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (showDeleted_ != false) { + output.writeBool(4, showDeleted_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (showDeleted_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, showDeleted_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.ListProjectsRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.ListProjectsRequest other = + (com.google.cloud.resourcemanager.v3.ListProjectsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (getShowDeleted() != other.getShowDeleted()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + SHOW_DELETED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getShowDeleted()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.ListProjectsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request sent to the
+   * [ListProjects][google.cloud.resourcemanager.v3.Projects.ListProjects]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.ListProjectsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.ListProjectsRequest) + com.google.cloud.resourcemanager.v3.ListProjectsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_ListProjectsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_ListProjectsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.ListProjectsRequest.class, + com.google.cloud.resourcemanager.v3.ListProjectsRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.ListProjectsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageToken_ = ""; + + pageSize_ = 0; + + showDeleted_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_ListProjectsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListProjectsRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.ListProjectsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListProjectsRequest build() { + com.google.cloud.resourcemanager.v3.ListProjectsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListProjectsRequest buildPartial() { + com.google.cloud.resourcemanager.v3.ListProjectsRequest result = + new com.google.cloud.resourcemanager.v3.ListProjectsRequest(this); + result.parent_ = parent_; + result.pageToken_ = pageToken_; + result.pageSize_ = pageSize_; + result.showDeleted_ = showDeleted_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.ListProjectsRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.ListProjectsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.ListProjectsRequest other) { + if (other == com.google.cloud.resourcemanager.v3.ListProjectsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (other.getShowDeleted() != false) { + setShowDeleted(other.getShowDeleted()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.ListProjectsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.ListProjectsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The name of the parent resource to list projects under.
+     * For example, setting this field to 'folders/1234' would list all projects
+     * directly under that folder.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the parent resource to list projects under.
+     * For example, setting this field to 'folders/1234' would list all projects
+     * directly under that folder.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the parent resource to list projects under.
+     * For example, setting this field to 'folders/1234' would list all projects
+     * directly under that folder.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource to list projects under.
+     * For example, setting this field to 'folders/1234' would list all projects
+     * directly under that folder.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the parent resource to list projects under.
+     * For example, setting this field to 'folders/1234' would list all projects
+     * directly under that folder.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to [ListProjects]
+     * [google.cloud.resourcemanager.v3.Projects.ListProjects]
+     * that indicates from where listing should continue.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to [ListProjects]
+     * [google.cloud.resourcemanager.v3.Projects.ListProjects]
+     * that indicates from where listing should continue.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to [ListProjects]
+     * [google.cloud.resourcemanager.v3.Projects.ListProjects]
+     * that indicates from where listing should continue.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + 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.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + 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.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * 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.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + 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.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private boolean showDeleted_; + /** + * + * + *
+     * Optional. Indicate that projects in the `DELETE_REQUESTED` state should also be
+     * returned. Normally only `ACTIVE` projects are returned.
+     * 
+ * + * bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The showDeleted. + */ + @java.lang.Override + public boolean getShowDeleted() { + return showDeleted_; + } + /** + * + * + *
+     * Optional. Indicate that projects in the `DELETE_REQUESTED` state should also be
+     * returned. Normally only `ACTIVE` projects are returned.
+     * 
+ * + * bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The showDeleted to set. + * @return This builder for chaining. + */ + public Builder setShowDeleted(boolean value) { + + showDeleted_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Indicate that projects in the `DELETE_REQUESTED` state should also be
+     * returned. Normally only `ACTIVE` projects are returned.
+     * 
+ * + * bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearShowDeleted() { + + showDeleted_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.ListProjectsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.ListProjectsRequest) + private static final com.google.cloud.resourcemanager.v3.ListProjectsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.ListProjectsRequest(); + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListProjectsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProjectsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListProjectsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListProjectsRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListProjectsRequestOrBuilder.java new file mode 100644 index 000000000000..8a34738a34ee --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListProjectsRequestOrBuilder.java @@ -0,0 +1,116 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +public interface ListProjectsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.ListProjectsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the parent resource to list projects under.
+   * For example, setting this field to 'folders/1234' would list all projects
+   * directly under that folder.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the parent resource to list projects under.
+   * For example, setting this field to 'folders/1234' would list all projects
+   * directly under that folder.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to [ListProjects]
+   * [google.cloud.resourcemanager.v3.Projects.ListProjects]
+   * that indicates from where listing should continue.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to [ListProjects]
+   * [google.cloud.resourcemanager.v3.Projects.ListProjects]
+   * that indicates from where listing should continue.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. Indicate that projects in the `DELETE_REQUESTED` state should also be
+   * returned. Normally only `ACTIVE` projects are returned.
+   * 
+ * + * bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The showDeleted. + */ + boolean getShowDeleted(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListProjectsResponse.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListProjectsResponse.java new file mode 100644 index 000000000000..9030640056b4 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListProjectsResponse.java @@ -0,0 +1,1193 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * A page of the response received from the
+ * [ListProjects][google.cloud.resourcemanager.v3.Projects.ListProjects]
+ * method.
+ * A paginated response where more pages are available has
+ * `next_page_token` set. This token can be used in a subsequent request to
+ * retrieve the next request page.
+ * NOTE: A response may contain fewer elements than the request `page_size` and
+ * still have a `next_page_token`.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.ListProjectsResponse} + */ +public final class ListProjectsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.ListProjectsResponse) + ListProjectsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListProjectsResponse.newBuilder() to construct. + private ListProjectsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListProjectsResponse() { + projects_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListProjectsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListProjectsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + projects_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + projects_.add( + input.readMessage( + com.google.cloud.resourcemanager.v3.Project.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + projects_ = java.util.Collections.unmodifiableList(projects_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_ListProjectsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_ListProjectsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.ListProjectsResponse.class, + com.google.cloud.resourcemanager.v3.ListProjectsResponse.Builder.class); + } + + public static final int PROJECTS_FIELD_NUMBER = 1; + private java.util.List projects_; + /** + * + * + *
+   * The list of Projects under the parent. This list can be paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + @java.lang.Override + public java.util.List getProjectsList() { + return projects_; + } + /** + * + * + *
+   * The list of Projects under the parent. This list can be paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + @java.lang.Override + public java.util.List + getProjectsOrBuilderList() { + return projects_; + } + /** + * + * + *
+   * The list of Projects under the parent. This list can be paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + @java.lang.Override + public int getProjectsCount() { + return projects_.size(); + } + /** + * + * + *
+   * The list of Projects under the parent. This list can be paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Project getProjects(int index) { + return projects_.get(index); + } + /** + * + * + *
+   * The list of Projects under the parent. This list can be paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ProjectOrBuilder getProjectsOrBuilder(int index) { + return projects_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * 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.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * 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.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < projects_.size(); i++) { + output.writeMessage(1, projects_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < projects_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, projects_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.ListProjectsResponse)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.ListProjectsResponse other = + (com.google.cloud.resourcemanager.v3.ListProjectsResponse) obj; + + if (!getProjectsList().equals(other.getProjectsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getProjectsCount() > 0) { + hash = (37 * hash) + PROJECTS_FIELD_NUMBER; + hash = (53 * hash) + getProjectsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.ListProjectsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A page of the response received from the
+   * [ListProjects][google.cloud.resourcemanager.v3.Projects.ListProjects]
+   * method.
+   * A paginated response where more pages are available has
+   * `next_page_token` set. This token can be used in a subsequent request to
+   * retrieve the next request page.
+   * NOTE: A response may contain fewer elements than the request `page_size` and
+   * still have a `next_page_token`.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.ListProjectsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.ListProjectsResponse) + com.google.cloud.resourcemanager.v3.ListProjectsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_ListProjectsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_ListProjectsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.ListProjectsResponse.class, + com.google.cloud.resourcemanager.v3.ListProjectsResponse.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.ListProjectsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getProjectsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (projectsBuilder_ == null) { + projects_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + projectsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_ListProjectsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListProjectsResponse getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.ListProjectsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListProjectsResponse build() { + com.google.cloud.resourcemanager.v3.ListProjectsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListProjectsResponse buildPartial() { + com.google.cloud.resourcemanager.v3.ListProjectsResponse result = + new com.google.cloud.resourcemanager.v3.ListProjectsResponse(this); + int from_bitField0_ = bitField0_; + if (projectsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + projects_ = java.util.Collections.unmodifiableList(projects_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.projects_ = projects_; + } else { + result.projects_ = projectsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.ListProjectsResponse) { + return mergeFrom((com.google.cloud.resourcemanager.v3.ListProjectsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.ListProjectsResponse other) { + if (other == com.google.cloud.resourcemanager.v3.ListProjectsResponse.getDefaultInstance()) + return this; + if (projectsBuilder_ == null) { + if (!other.projects_.isEmpty()) { + if (projects_.isEmpty()) { + projects_ = other.projects_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureProjectsIsMutable(); + projects_.addAll(other.projects_); + } + onChanged(); + } + } else { + if (!other.projects_.isEmpty()) { + if (projectsBuilder_.isEmpty()) { + projectsBuilder_.dispose(); + projectsBuilder_ = null; + projects_ = other.projects_; + bitField0_ = (bitField0_ & ~0x00000001); + projectsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getProjectsFieldBuilder() + : null; + } else { + projectsBuilder_.addAllMessages(other.projects_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.ListProjectsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.ListProjectsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List projects_ = + java.util.Collections.emptyList(); + + private void ensureProjectsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + projects_ = new java.util.ArrayList(projects_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Project, + com.google.cloud.resourcemanager.v3.Project.Builder, + com.google.cloud.resourcemanager.v3.ProjectOrBuilder> + projectsBuilder_; + + /** + * + * + *
+     * The list of Projects under the parent. This list can be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public java.util.List getProjectsList() { + if (projectsBuilder_ == null) { + return java.util.Collections.unmodifiableList(projects_); + } else { + return projectsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of Projects under the parent. This list can be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public int getProjectsCount() { + if (projectsBuilder_ == null) { + return projects_.size(); + } else { + return projectsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of Projects under the parent. This list can be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public com.google.cloud.resourcemanager.v3.Project getProjects(int index) { + if (projectsBuilder_ == null) { + return projects_.get(index); + } else { + return projectsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of Projects under the parent. This list can be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public Builder setProjects(int index, com.google.cloud.resourcemanager.v3.Project value) { + if (projectsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProjectsIsMutable(); + projects_.set(index, value); + onChanged(); + } else { + projectsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Projects under the parent. This list can be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public Builder setProjects( + int index, com.google.cloud.resourcemanager.v3.Project.Builder builderForValue) { + if (projectsBuilder_ == null) { + ensureProjectsIsMutable(); + projects_.set(index, builderForValue.build()); + onChanged(); + } else { + projectsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Projects under the parent. This list can be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public Builder addProjects(com.google.cloud.resourcemanager.v3.Project value) { + if (projectsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProjectsIsMutable(); + projects_.add(value); + onChanged(); + } else { + projectsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of Projects under the parent. This list can be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public Builder addProjects(int index, com.google.cloud.resourcemanager.v3.Project value) { + if (projectsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProjectsIsMutable(); + projects_.add(index, value); + onChanged(); + } else { + projectsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Projects under the parent. This list can be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public Builder addProjects( + com.google.cloud.resourcemanager.v3.Project.Builder builderForValue) { + if (projectsBuilder_ == null) { + ensureProjectsIsMutable(); + projects_.add(builderForValue.build()); + onChanged(); + } else { + projectsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Projects under the parent. This list can be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public Builder addProjects( + int index, com.google.cloud.resourcemanager.v3.Project.Builder builderForValue) { + if (projectsBuilder_ == null) { + ensureProjectsIsMutable(); + projects_.add(index, builderForValue.build()); + onChanged(); + } else { + projectsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Projects under the parent. This list can be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public Builder addAllProjects( + java.lang.Iterable values) { + if (projectsBuilder_ == null) { + ensureProjectsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, projects_); + onChanged(); + } else { + projectsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of Projects under the parent. This list can be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public Builder clearProjects() { + if (projectsBuilder_ == null) { + projects_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + projectsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of Projects under the parent. This list can be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public Builder removeProjects(int index) { + if (projectsBuilder_ == null) { + ensureProjectsIsMutable(); + projects_.remove(index); + onChanged(); + } else { + projectsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of Projects under the parent. This list can be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public com.google.cloud.resourcemanager.v3.Project.Builder getProjectsBuilder(int index) { + return getProjectsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of Projects under the parent. This list can be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public com.google.cloud.resourcemanager.v3.ProjectOrBuilder getProjectsOrBuilder(int index) { + if (projectsBuilder_ == null) { + return projects_.get(index); + } else { + return projectsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of Projects under the parent. This list can be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public java.util.List + getProjectsOrBuilderList() { + if (projectsBuilder_ != null) { + return projectsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(projects_); + } + } + /** + * + * + *
+     * The list of Projects under the parent. This list can be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public com.google.cloud.resourcemanager.v3.Project.Builder addProjectsBuilder() { + return getProjectsFieldBuilder() + .addBuilder(com.google.cloud.resourcemanager.v3.Project.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Projects under the parent. This list can be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public com.google.cloud.resourcemanager.v3.Project.Builder addProjectsBuilder(int index) { + return getProjectsFieldBuilder() + .addBuilder(index, com.google.cloud.resourcemanager.v3.Project.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Projects under the parent. This list can be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public java.util.List + getProjectsBuilderList() { + return getProjectsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Project, + com.google.cloud.resourcemanager.v3.Project.Builder, + com.google.cloud.resourcemanager.v3.ProjectOrBuilder> + getProjectsFieldBuilder() { + if (projectsBuilder_ == null) { + projectsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Project, + com.google.cloud.resourcemanager.v3.Project.Builder, + com.google.cloud.resourcemanager.v3.ProjectOrBuilder>( + projects_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + projects_ = null; + } + return projectsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * 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.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + 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.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + 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.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.ListProjectsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.ListProjectsResponse) + private static final com.google.cloud.resourcemanager.v3.ListProjectsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.ListProjectsResponse(); + } + + public static com.google.cloud.resourcemanager.v3.ListProjectsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListProjectsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProjectsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListProjectsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListProjectsResponseOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListProjectsResponseOrBuilder.java new file mode 100644 index 000000000000..a199e507ff52 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListProjectsResponseOrBuilder.java @@ -0,0 +1,116 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +public interface ListProjectsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.ListProjectsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of Projects under the parent. This list can be paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + java.util.List getProjectsList(); + /** + * + * + *
+   * The list of Projects under the parent. This list can be paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + com.google.cloud.resourcemanager.v3.Project getProjects(int index); + /** + * + * + *
+   * The list of Projects under the parent. This list can be paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + int getProjectsCount(); + /** + * + * + *
+   * The list of Projects under the parent. This list can be paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + java.util.List + getProjectsOrBuilderList(); + /** + * + * + *
+   * The list of Projects under the parent. This list can be paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + com.google.cloud.resourcemanager.v3.ProjectOrBuilder getProjectsOrBuilder(int index); + + /** + * + * + *
+   * 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.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * 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.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagBindingsRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagBindingsRequest.java new file mode 100644 index 000000000000..db9450b642c9 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagBindingsRequest.java @@ -0,0 +1,949 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_bindings.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The request message to list all TagBindings for a parent.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.ListTagBindingsRequest} + */ +public final class ListTagBindingsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.ListTagBindingsRequest) + ListTagBindingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListTagBindingsRequest.newBuilder() to construct. + private ListTagBindingsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListTagBindingsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListTagBindingsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListTagBindingsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_ListTagBindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_ListTagBindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.ListTagBindingsRequest.class, + com.google.cloud.resourcemanager.v3.ListTagBindingsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The full resource name of a resource for which you want to list existing
+   * TagBindings.
+   * E.g. "//cloudresourcemanager.googleapis.com/projects/123"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The full resource name of a resource for which you want to list existing
+   * TagBindings.
+   * E.g. "//cloudresourcemanager.googleapis.com/projects/123"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * 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.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to `ListTagBindings`
+   * that indicates where this listing should continue from.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to `ListTagBindings`
+   * that indicates where this listing should continue from.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.ListTagBindingsRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.ListTagBindingsRequest other = + (com.google.cloud.resourcemanager.v3.ListTagBindingsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.ListTagBindingsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message to list all TagBindings for a parent.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.ListTagBindingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.ListTagBindingsRequest) + com.google.cloud.resourcemanager.v3.ListTagBindingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_ListTagBindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_ListTagBindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.ListTagBindingsRequest.class, + com.google.cloud.resourcemanager.v3.ListTagBindingsRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.ListTagBindingsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_ListTagBindingsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListTagBindingsRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.ListTagBindingsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListTagBindingsRequest build() { + com.google.cloud.resourcemanager.v3.ListTagBindingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListTagBindingsRequest buildPartial() { + com.google.cloud.resourcemanager.v3.ListTagBindingsRequest result = + new com.google.cloud.resourcemanager.v3.ListTagBindingsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.ListTagBindingsRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.ListTagBindingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.ListTagBindingsRequest other) { + if (other == com.google.cloud.resourcemanager.v3.ListTagBindingsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.ListTagBindingsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.ListTagBindingsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The full resource name of a resource for which you want to list existing
+     * TagBindings.
+     * E.g. "//cloudresourcemanager.googleapis.com/projects/123"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The full resource name of a resource for which you want to list existing
+     * TagBindings.
+     * E.g. "//cloudresourcemanager.googleapis.com/projects/123"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The full resource name of a resource for which you want to list existing
+     * TagBindings.
+     * E.g. "//cloudresourcemanager.googleapis.com/projects/123"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The full resource name of a resource for which you want to list existing
+     * TagBindings.
+     * E.g. "//cloudresourcemanager.googleapis.com/projects/123"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The full resource name of a resource for which you want to list existing
+     * TagBindings.
+     * E.g. "//cloudresourcemanager.googleapis.com/projects/123"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * 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.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + 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.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `ListTagBindings`
+     * that indicates where this listing should continue from.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `ListTagBindings`
+     * that indicates where this listing should continue from.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `ListTagBindings`
+     * that indicates where this listing should continue from.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `ListTagBindings`
+     * that indicates where this listing should continue from.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `ListTagBindings`
+     * that indicates where this listing should continue from.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.ListTagBindingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.ListTagBindingsRequest) + private static final com.google.cloud.resourcemanager.v3.ListTagBindingsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.ListTagBindingsRequest(); + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTagBindingsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListTagBindingsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListTagBindingsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagBindingsRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagBindingsRequestOrBuilder.java new file mode 100644 index 000000000000..0b0fabad6aaa --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagBindingsRequestOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_bindings.proto + +package com.google.cloud.resourcemanager.v3; + +public interface ListTagBindingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.ListTagBindingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The full resource name of a resource for which you want to list existing
+   * TagBindings.
+   * E.g. "//cloudresourcemanager.googleapis.com/projects/123"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The full resource name of a resource for which you want to list existing
+   * TagBindings.
+   * E.g. "//cloudresourcemanager.googleapis.com/projects/123"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to `ListTagBindings`
+   * that indicates where this listing should continue from.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to `ListTagBindings`
+   * that indicates where this listing should continue from.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagBindingsResponse.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagBindingsResponse.java new file mode 100644 index 000000000000..5b3a92e929ee --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagBindingsResponse.java @@ -0,0 +1,1206 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_bindings.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The ListTagBindings response.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.ListTagBindingsResponse} + */ +public final class ListTagBindingsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.ListTagBindingsResponse) + ListTagBindingsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListTagBindingsResponse.newBuilder() to construct. + private ListTagBindingsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListTagBindingsResponse() { + tagBindings_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListTagBindingsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListTagBindingsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + tagBindings_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + tagBindings_.add( + input.readMessage( + com.google.cloud.resourcemanager.v3.TagBinding.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + tagBindings_ = java.util.Collections.unmodifiableList(tagBindings_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_ListTagBindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_ListTagBindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.ListTagBindingsResponse.class, + com.google.cloud.resourcemanager.v3.ListTagBindingsResponse.Builder.class); + } + + public static final int TAG_BINDINGS_FIELD_NUMBER = 1; + private java.util.List tagBindings_; + /** + * + * + *
+   * A possibly paginated list of TagBindings for the specified TagValue or
+   * resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + @java.lang.Override + public java.util.List getTagBindingsList() { + return tagBindings_; + } + /** + * + * + *
+   * A possibly paginated list of TagBindings for the specified TagValue or
+   * resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + @java.lang.Override + public java.util.List + getTagBindingsOrBuilderList() { + return tagBindings_; + } + /** + * + * + *
+   * A possibly paginated list of TagBindings for the specified TagValue or
+   * resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + @java.lang.Override + public int getTagBindingsCount() { + return tagBindings_.size(); + } + /** + * + * + *
+   * A possibly paginated list of TagBindings for the specified TagValue or
+   * resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagBinding getTagBindings(int index) { + return tagBindings_.get(index); + } + /** + * + * + *
+   * A possibly paginated list of TagBindings for the specified TagValue or
+   * resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagBindingOrBuilder getTagBindingsOrBuilder( + int index) { + return tagBindings_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * 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.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * 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.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < tagBindings_.size(); i++) { + output.writeMessage(1, tagBindings_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < tagBindings_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, tagBindings_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.ListTagBindingsResponse)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.ListTagBindingsResponse other = + (com.google.cloud.resourcemanager.v3.ListTagBindingsResponse) obj; + + if (!getTagBindingsList().equals(other.getTagBindingsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getTagBindingsCount() > 0) { + hash = (37 * hash) + TAG_BINDINGS_FIELD_NUMBER; + hash = (53 * hash) + getTagBindingsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.ListTagBindingsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The ListTagBindings response.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.ListTagBindingsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.ListTagBindingsResponse) + com.google.cloud.resourcemanager.v3.ListTagBindingsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_ListTagBindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_ListTagBindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.ListTagBindingsResponse.class, + com.google.cloud.resourcemanager.v3.ListTagBindingsResponse.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.ListTagBindingsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTagBindingsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (tagBindingsBuilder_ == null) { + tagBindings_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + tagBindingsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_ListTagBindingsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListTagBindingsResponse getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.ListTagBindingsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListTagBindingsResponse build() { + com.google.cloud.resourcemanager.v3.ListTagBindingsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListTagBindingsResponse buildPartial() { + com.google.cloud.resourcemanager.v3.ListTagBindingsResponse result = + new com.google.cloud.resourcemanager.v3.ListTagBindingsResponse(this); + int from_bitField0_ = bitField0_; + if (tagBindingsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + tagBindings_ = java.util.Collections.unmodifiableList(tagBindings_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.tagBindings_ = tagBindings_; + } else { + result.tagBindings_ = tagBindingsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.ListTagBindingsResponse) { + return mergeFrom((com.google.cloud.resourcemanager.v3.ListTagBindingsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.ListTagBindingsResponse other) { + if (other == com.google.cloud.resourcemanager.v3.ListTagBindingsResponse.getDefaultInstance()) + return this; + if (tagBindingsBuilder_ == null) { + if (!other.tagBindings_.isEmpty()) { + if (tagBindings_.isEmpty()) { + tagBindings_ = other.tagBindings_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTagBindingsIsMutable(); + tagBindings_.addAll(other.tagBindings_); + } + onChanged(); + } + } else { + if (!other.tagBindings_.isEmpty()) { + if (tagBindingsBuilder_.isEmpty()) { + tagBindingsBuilder_.dispose(); + tagBindingsBuilder_ = null; + tagBindings_ = other.tagBindings_; + bitField0_ = (bitField0_ & ~0x00000001); + tagBindingsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTagBindingsFieldBuilder() + : null; + } else { + tagBindingsBuilder_.addAllMessages(other.tagBindings_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.ListTagBindingsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.ListTagBindingsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List tagBindings_ = + java.util.Collections.emptyList(); + + private void ensureTagBindingsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + tagBindings_ = + new java.util.ArrayList(tagBindings_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.resourcemanager.v3.TagBinding, + com.google.cloud.resourcemanager.v3.TagBinding.Builder, + com.google.cloud.resourcemanager.v3.TagBindingOrBuilder> + tagBindingsBuilder_; + + /** + * + * + *
+     * A possibly paginated list of TagBindings for the specified TagValue or
+     * resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + public java.util.List getTagBindingsList() { + if (tagBindingsBuilder_ == null) { + return java.util.Collections.unmodifiableList(tagBindings_); + } else { + return tagBindingsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A possibly paginated list of TagBindings for the specified TagValue or
+     * resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + public int getTagBindingsCount() { + if (tagBindingsBuilder_ == null) { + return tagBindings_.size(); + } else { + return tagBindingsBuilder_.getCount(); + } + } + /** + * + * + *
+     * A possibly paginated list of TagBindings for the specified TagValue or
+     * resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + public com.google.cloud.resourcemanager.v3.TagBinding getTagBindings(int index) { + if (tagBindingsBuilder_ == null) { + return tagBindings_.get(index); + } else { + return tagBindingsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A possibly paginated list of TagBindings for the specified TagValue or
+     * resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + public Builder setTagBindings(int index, com.google.cloud.resourcemanager.v3.TagBinding value) { + if (tagBindingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagBindingsIsMutable(); + tagBindings_.set(index, value); + onChanged(); + } else { + tagBindingsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of TagBindings for the specified TagValue or
+     * resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + public Builder setTagBindings( + int index, com.google.cloud.resourcemanager.v3.TagBinding.Builder builderForValue) { + if (tagBindingsBuilder_ == null) { + ensureTagBindingsIsMutable(); + tagBindings_.set(index, builderForValue.build()); + onChanged(); + } else { + tagBindingsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of TagBindings for the specified TagValue or
+     * resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + public Builder addTagBindings(com.google.cloud.resourcemanager.v3.TagBinding value) { + if (tagBindingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagBindingsIsMutable(); + tagBindings_.add(value); + onChanged(); + } else { + tagBindingsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of TagBindings for the specified TagValue or
+     * resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + public Builder addTagBindings(int index, com.google.cloud.resourcemanager.v3.TagBinding value) { + if (tagBindingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagBindingsIsMutable(); + tagBindings_.add(index, value); + onChanged(); + } else { + tagBindingsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of TagBindings for the specified TagValue or
+     * resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + public Builder addTagBindings( + com.google.cloud.resourcemanager.v3.TagBinding.Builder builderForValue) { + if (tagBindingsBuilder_ == null) { + ensureTagBindingsIsMutable(); + tagBindings_.add(builderForValue.build()); + onChanged(); + } else { + tagBindingsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of TagBindings for the specified TagValue or
+     * resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + public Builder addTagBindings( + int index, com.google.cloud.resourcemanager.v3.TagBinding.Builder builderForValue) { + if (tagBindingsBuilder_ == null) { + ensureTagBindingsIsMutable(); + tagBindings_.add(index, builderForValue.build()); + onChanged(); + } else { + tagBindingsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of TagBindings for the specified TagValue or
+     * resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + public Builder addAllTagBindings( + java.lang.Iterable values) { + if (tagBindingsBuilder_ == null) { + ensureTagBindingsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tagBindings_); + onChanged(); + } else { + tagBindingsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of TagBindings for the specified TagValue or
+     * resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + public Builder clearTagBindings() { + if (tagBindingsBuilder_ == null) { + tagBindings_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + tagBindingsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of TagBindings for the specified TagValue or
+     * resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + public Builder removeTagBindings(int index) { + if (tagBindingsBuilder_ == null) { + ensureTagBindingsIsMutable(); + tagBindings_.remove(index); + onChanged(); + } else { + tagBindingsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of TagBindings for the specified TagValue or
+     * resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + public com.google.cloud.resourcemanager.v3.TagBinding.Builder getTagBindingsBuilder(int index) { + return getTagBindingsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A possibly paginated list of TagBindings for the specified TagValue or
+     * resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + public com.google.cloud.resourcemanager.v3.TagBindingOrBuilder getTagBindingsOrBuilder( + int index) { + if (tagBindingsBuilder_ == null) { + return tagBindings_.get(index); + } else { + return tagBindingsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A possibly paginated list of TagBindings for the specified TagValue or
+     * resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + public java.util.List + getTagBindingsOrBuilderList() { + if (tagBindingsBuilder_ != null) { + return tagBindingsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(tagBindings_); + } + } + /** + * + * + *
+     * A possibly paginated list of TagBindings for the specified TagValue or
+     * resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + public com.google.cloud.resourcemanager.v3.TagBinding.Builder addTagBindingsBuilder() { + return getTagBindingsFieldBuilder() + .addBuilder(com.google.cloud.resourcemanager.v3.TagBinding.getDefaultInstance()); + } + /** + * + * + *
+     * A possibly paginated list of TagBindings for the specified TagValue or
+     * resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + public com.google.cloud.resourcemanager.v3.TagBinding.Builder addTagBindingsBuilder(int index) { + return getTagBindingsFieldBuilder() + .addBuilder(index, com.google.cloud.resourcemanager.v3.TagBinding.getDefaultInstance()); + } + /** + * + * + *
+     * A possibly paginated list of TagBindings for the specified TagValue or
+     * resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + public java.util.List + getTagBindingsBuilderList() { + return getTagBindingsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.resourcemanager.v3.TagBinding, + com.google.cloud.resourcemanager.v3.TagBinding.Builder, + com.google.cloud.resourcemanager.v3.TagBindingOrBuilder> + getTagBindingsFieldBuilder() { + if (tagBindingsBuilder_ == null) { + tagBindingsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.resourcemanager.v3.TagBinding, + com.google.cloud.resourcemanager.v3.TagBinding.Builder, + com.google.cloud.resourcemanager.v3.TagBindingOrBuilder>( + tagBindings_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + tagBindings_ = null; + } + return tagBindingsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * 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.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + 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.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + 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.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.ListTagBindingsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.ListTagBindingsResponse) + private static final com.google.cloud.resourcemanager.v3.ListTagBindingsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.ListTagBindingsResponse(); + } + + public static com.google.cloud.resourcemanager.v3.ListTagBindingsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTagBindingsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListTagBindingsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListTagBindingsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagBindingsResponseOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagBindingsResponseOrBuilder.java new file mode 100644 index 000000000000..91d1d20903ad --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagBindingsResponseOrBuilder.java @@ -0,0 +1,121 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_bindings.proto + +package com.google.cloud.resourcemanager.v3; + +public interface ListTagBindingsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.ListTagBindingsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A possibly paginated list of TagBindings for the specified TagValue or
+   * resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + java.util.List getTagBindingsList(); + /** + * + * + *
+   * A possibly paginated list of TagBindings for the specified TagValue or
+   * resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + com.google.cloud.resourcemanager.v3.TagBinding getTagBindings(int index); + /** + * + * + *
+   * A possibly paginated list of TagBindings for the specified TagValue or
+   * resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + int getTagBindingsCount(); + /** + * + * + *
+   * A possibly paginated list of TagBindings for the specified TagValue or
+   * resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + java.util.List + getTagBindingsOrBuilderList(); + /** + * + * + *
+   * A possibly paginated list of TagBindings for the specified TagValue or
+   * resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagBinding tag_bindings = 1; + */ + com.google.cloud.resourcemanager.v3.TagBindingOrBuilder getTagBindingsOrBuilder(int index); + + /** + * + * + *
+   * 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.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * 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.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagKeysRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagKeysRequest.java new file mode 100644 index 000000000000..4e5015ed05d0 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagKeysRequest.java @@ -0,0 +1,942 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_keys.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The request message for listing all TagKeys under a parent resource.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.ListTagKeysRequest} + */ +public final class ListTagKeysRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.ListTagKeysRequest) + ListTagKeysRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListTagKeysRequest.newBuilder() to construct. + private ListTagKeysRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListTagKeysRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListTagKeysRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListTagKeysRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_ListTagKeysRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_ListTagKeysRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.ListTagKeysRequest.class, + com.google.cloud.resourcemanager.v3.ListTagKeysRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The resource name of the new TagKey's parent.
+   * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the new TagKey's parent.
+   * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * 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.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to `ListTagKey`
+   * that indicates where this listing should continue from.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to `ListTagKey`
+   * that indicates where this listing should continue from.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.ListTagKeysRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.ListTagKeysRequest other = + (com.google.cloud.resourcemanager.v3.ListTagKeysRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.ListTagKeysRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for listing all TagKeys under a parent resource.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.ListTagKeysRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.ListTagKeysRequest) + com.google.cloud.resourcemanager.v3.ListTagKeysRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_ListTagKeysRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_ListTagKeysRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.ListTagKeysRequest.class, + com.google.cloud.resourcemanager.v3.ListTagKeysRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.ListTagKeysRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_ListTagKeysRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListTagKeysRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.ListTagKeysRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListTagKeysRequest build() { + com.google.cloud.resourcemanager.v3.ListTagKeysRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListTagKeysRequest buildPartial() { + com.google.cloud.resourcemanager.v3.ListTagKeysRequest result = + new com.google.cloud.resourcemanager.v3.ListTagKeysRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.ListTagKeysRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.ListTagKeysRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.ListTagKeysRequest other) { + if (other == com.google.cloud.resourcemanager.v3.ListTagKeysRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.ListTagKeysRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.ListTagKeysRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The resource name of the new TagKey's parent.
+     * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the new TagKey's parent.
+     * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the new TagKey's parent.
+     * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the new TagKey's parent.
+     * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the new TagKey's parent.
+     * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * 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.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + 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.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `ListTagKey`
+     * that indicates where this listing should continue from.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `ListTagKey`
+     * that indicates where this listing should continue from.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `ListTagKey`
+     * that indicates where this listing should continue from.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `ListTagKey`
+     * that indicates where this listing should continue from.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `ListTagKey`
+     * that indicates where this listing should continue from.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.ListTagKeysRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.ListTagKeysRequest) + private static final com.google.cloud.resourcemanager.v3.ListTagKeysRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.ListTagKeysRequest(); + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTagKeysRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListTagKeysRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListTagKeysRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagKeysRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagKeysRequestOrBuilder.java new file mode 100644 index 000000000000..f40db8b2ade7 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagKeysRequestOrBuilder.java @@ -0,0 +1,98 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_keys.proto + +package com.google.cloud.resourcemanager.v3; + +public interface ListTagKeysRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.ListTagKeysRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the new TagKey's parent.
+   * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource name of the new TagKey's parent.
+   * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to `ListTagKey`
+   * that indicates where this listing should continue from.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to `ListTagKey`
+   * that indicates where this listing should continue from.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagKeysResponse.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagKeysResponse.java new file mode 100644 index 000000000000..6baa0ed74c62 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagKeysResponse.java @@ -0,0 +1,1136 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_keys.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The ListTagKeys response message.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.ListTagKeysResponse} + */ +public final class ListTagKeysResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.ListTagKeysResponse) + ListTagKeysResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListTagKeysResponse.newBuilder() to construct. + private ListTagKeysResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListTagKeysResponse() { + tagKeys_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListTagKeysResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListTagKeysResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + tagKeys_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + tagKeys_.add( + input.readMessage( + com.google.cloud.resourcemanager.v3.TagKey.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + tagKeys_ = java.util.Collections.unmodifiableList(tagKeys_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_ListTagKeysResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_ListTagKeysResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.ListTagKeysResponse.class, + com.google.cloud.resourcemanager.v3.ListTagKeysResponse.Builder.class); + } + + public static final int TAG_KEYS_FIELD_NUMBER = 1; + private java.util.List tagKeys_; + /** + * + * + *
+   * List of TagKeys that live under the specified parent in the request.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + @java.lang.Override + public java.util.List getTagKeysList() { + return tagKeys_; + } + /** + * + * + *
+   * List of TagKeys that live under the specified parent in the request.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + @java.lang.Override + public java.util.List + getTagKeysOrBuilderList() { + return tagKeys_; + } + /** + * + * + *
+   * List of TagKeys that live under the specified parent in the request.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + @java.lang.Override + public int getTagKeysCount() { + return tagKeys_.size(); + } + /** + * + * + *
+   * List of TagKeys that live under the specified parent in the request.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagKey getTagKeys(int index) { + return tagKeys_.get(index); + } + /** + * + * + *
+   * List of TagKeys that live under the specified parent in the request.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagKeyOrBuilder getTagKeysOrBuilder(int index) { + return tagKeys_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A pagination token returned from a previous call to `ListTagKeys`
+   * that indicates from where listing should continue.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A pagination token returned from a previous call to `ListTagKeys`
+   * that indicates from where listing should continue.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < tagKeys_.size(); i++) { + output.writeMessage(1, tagKeys_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < tagKeys_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, tagKeys_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.ListTagKeysResponse)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.ListTagKeysResponse other = + (com.google.cloud.resourcemanager.v3.ListTagKeysResponse) obj; + + if (!getTagKeysList().equals(other.getTagKeysList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getTagKeysCount() > 0) { + hash = (37 * hash) + TAG_KEYS_FIELD_NUMBER; + hash = (53 * hash) + getTagKeysList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.ListTagKeysResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The ListTagKeys response message.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.ListTagKeysResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.ListTagKeysResponse) + com.google.cloud.resourcemanager.v3.ListTagKeysResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_ListTagKeysResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_ListTagKeysResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.ListTagKeysResponse.class, + com.google.cloud.resourcemanager.v3.ListTagKeysResponse.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.ListTagKeysResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTagKeysFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (tagKeysBuilder_ == null) { + tagKeys_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + tagKeysBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_ListTagKeysResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListTagKeysResponse getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.ListTagKeysResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListTagKeysResponse build() { + com.google.cloud.resourcemanager.v3.ListTagKeysResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListTagKeysResponse buildPartial() { + com.google.cloud.resourcemanager.v3.ListTagKeysResponse result = + new com.google.cloud.resourcemanager.v3.ListTagKeysResponse(this); + int from_bitField0_ = bitField0_; + if (tagKeysBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + tagKeys_ = java.util.Collections.unmodifiableList(tagKeys_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.tagKeys_ = tagKeys_; + } else { + result.tagKeys_ = tagKeysBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.ListTagKeysResponse) { + return mergeFrom((com.google.cloud.resourcemanager.v3.ListTagKeysResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.ListTagKeysResponse other) { + if (other == com.google.cloud.resourcemanager.v3.ListTagKeysResponse.getDefaultInstance()) + return this; + if (tagKeysBuilder_ == null) { + if (!other.tagKeys_.isEmpty()) { + if (tagKeys_.isEmpty()) { + tagKeys_ = other.tagKeys_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTagKeysIsMutable(); + tagKeys_.addAll(other.tagKeys_); + } + onChanged(); + } + } else { + if (!other.tagKeys_.isEmpty()) { + if (tagKeysBuilder_.isEmpty()) { + tagKeysBuilder_.dispose(); + tagKeysBuilder_ = null; + tagKeys_ = other.tagKeys_; + bitField0_ = (bitField0_ & ~0x00000001); + tagKeysBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTagKeysFieldBuilder() + : null; + } else { + tagKeysBuilder_.addAllMessages(other.tagKeys_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.ListTagKeysResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.ListTagKeysResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List tagKeys_ = + java.util.Collections.emptyList(); + + private void ensureTagKeysIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + tagKeys_ = new java.util.ArrayList(tagKeys_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.resourcemanager.v3.TagKey, + com.google.cloud.resourcemanager.v3.TagKey.Builder, + com.google.cloud.resourcemanager.v3.TagKeyOrBuilder> + tagKeysBuilder_; + + /** + * + * + *
+     * List of TagKeys that live under the specified parent in the request.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + public java.util.List getTagKeysList() { + if (tagKeysBuilder_ == null) { + return java.util.Collections.unmodifiableList(tagKeys_); + } else { + return tagKeysBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of TagKeys that live under the specified parent in the request.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + public int getTagKeysCount() { + if (tagKeysBuilder_ == null) { + return tagKeys_.size(); + } else { + return tagKeysBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of TagKeys that live under the specified parent in the request.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + public com.google.cloud.resourcemanager.v3.TagKey getTagKeys(int index) { + if (tagKeysBuilder_ == null) { + return tagKeys_.get(index); + } else { + return tagKeysBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of TagKeys that live under the specified parent in the request.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + public Builder setTagKeys(int index, com.google.cloud.resourcemanager.v3.TagKey value) { + if (tagKeysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagKeysIsMutable(); + tagKeys_.set(index, value); + onChanged(); + } else { + tagKeysBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of TagKeys that live under the specified parent in the request.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + public Builder setTagKeys( + int index, com.google.cloud.resourcemanager.v3.TagKey.Builder builderForValue) { + if (tagKeysBuilder_ == null) { + ensureTagKeysIsMutable(); + tagKeys_.set(index, builderForValue.build()); + onChanged(); + } else { + tagKeysBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of TagKeys that live under the specified parent in the request.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + public Builder addTagKeys(com.google.cloud.resourcemanager.v3.TagKey value) { + if (tagKeysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagKeysIsMutable(); + tagKeys_.add(value); + onChanged(); + } else { + tagKeysBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of TagKeys that live under the specified parent in the request.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + public Builder addTagKeys(int index, com.google.cloud.resourcemanager.v3.TagKey value) { + if (tagKeysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagKeysIsMutable(); + tagKeys_.add(index, value); + onChanged(); + } else { + tagKeysBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of TagKeys that live under the specified parent in the request.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + public Builder addTagKeys(com.google.cloud.resourcemanager.v3.TagKey.Builder builderForValue) { + if (tagKeysBuilder_ == null) { + ensureTagKeysIsMutable(); + tagKeys_.add(builderForValue.build()); + onChanged(); + } else { + tagKeysBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of TagKeys that live under the specified parent in the request.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + public Builder addTagKeys( + int index, com.google.cloud.resourcemanager.v3.TagKey.Builder builderForValue) { + if (tagKeysBuilder_ == null) { + ensureTagKeysIsMutable(); + tagKeys_.add(index, builderForValue.build()); + onChanged(); + } else { + tagKeysBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of TagKeys that live under the specified parent in the request.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + public Builder addAllTagKeys( + java.lang.Iterable values) { + if (tagKeysBuilder_ == null) { + ensureTagKeysIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tagKeys_); + onChanged(); + } else { + tagKeysBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of TagKeys that live under the specified parent in the request.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + public Builder clearTagKeys() { + if (tagKeysBuilder_ == null) { + tagKeys_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + tagKeysBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of TagKeys that live under the specified parent in the request.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + public Builder removeTagKeys(int index) { + if (tagKeysBuilder_ == null) { + ensureTagKeysIsMutable(); + tagKeys_.remove(index); + onChanged(); + } else { + tagKeysBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of TagKeys that live under the specified parent in the request.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + public com.google.cloud.resourcemanager.v3.TagKey.Builder getTagKeysBuilder(int index) { + return getTagKeysFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of TagKeys that live under the specified parent in the request.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + public com.google.cloud.resourcemanager.v3.TagKeyOrBuilder getTagKeysOrBuilder(int index) { + if (tagKeysBuilder_ == null) { + return tagKeys_.get(index); + } else { + return tagKeysBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of TagKeys that live under the specified parent in the request.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + public java.util.List + getTagKeysOrBuilderList() { + if (tagKeysBuilder_ != null) { + return tagKeysBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(tagKeys_); + } + } + /** + * + * + *
+     * List of TagKeys that live under the specified parent in the request.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + public com.google.cloud.resourcemanager.v3.TagKey.Builder addTagKeysBuilder() { + return getTagKeysFieldBuilder() + .addBuilder(com.google.cloud.resourcemanager.v3.TagKey.getDefaultInstance()); + } + /** + * + * + *
+     * List of TagKeys that live under the specified parent in the request.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + public com.google.cloud.resourcemanager.v3.TagKey.Builder addTagKeysBuilder(int index) { + return getTagKeysFieldBuilder() + .addBuilder(index, com.google.cloud.resourcemanager.v3.TagKey.getDefaultInstance()); + } + /** + * + * + *
+     * List of TagKeys that live under the specified parent in the request.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + public java.util.List + getTagKeysBuilderList() { + return getTagKeysFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.resourcemanager.v3.TagKey, + com.google.cloud.resourcemanager.v3.TagKey.Builder, + com.google.cloud.resourcemanager.v3.TagKeyOrBuilder> + getTagKeysFieldBuilder() { + if (tagKeysBuilder_ == null) { + tagKeysBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.resourcemanager.v3.TagKey, + com.google.cloud.resourcemanager.v3.TagKey.Builder, + com.google.cloud.resourcemanager.v3.TagKeyOrBuilder>( + tagKeys_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + tagKeys_ = null; + } + return tagKeysBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A pagination token returned from a previous call to `ListTagKeys`
+     * that indicates from where listing should continue.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A pagination token returned from a previous call to `ListTagKeys`
+     * that indicates from where listing should continue.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A pagination token returned from a previous call to `ListTagKeys`
+     * that indicates from where listing should continue.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A pagination token returned from a previous call to `ListTagKeys`
+     * that indicates from where listing should continue.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A pagination token returned from a previous call to `ListTagKeys`
+     * that indicates from where listing should continue.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.ListTagKeysResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.ListTagKeysResponse) + private static final com.google.cloud.resourcemanager.v3.ListTagKeysResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.ListTagKeysResponse(); + } + + public static com.google.cloud.resourcemanager.v3.ListTagKeysResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTagKeysResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListTagKeysResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListTagKeysResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagKeysResponseOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagKeysResponseOrBuilder.java new file mode 100644 index 000000000000..46bf1755b65f --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagKeysResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_keys.proto + +package com.google.cloud.resourcemanager.v3; + +public interface ListTagKeysResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.ListTagKeysResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of TagKeys that live under the specified parent in the request.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + java.util.List getTagKeysList(); + /** + * + * + *
+   * List of TagKeys that live under the specified parent in the request.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + com.google.cloud.resourcemanager.v3.TagKey getTagKeys(int index); + /** + * + * + *
+   * List of TagKeys that live under the specified parent in the request.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + int getTagKeysCount(); + /** + * + * + *
+   * List of TagKeys that live under the specified parent in the request.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + java.util.List + getTagKeysOrBuilderList(); + /** + * + * + *
+   * List of TagKeys that live under the specified parent in the request.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagKey tag_keys = 1; + */ + com.google.cloud.resourcemanager.v3.TagKeyOrBuilder getTagKeysOrBuilder(int index); + + /** + * + * + *
+   * A pagination token returned from a previous call to `ListTagKeys`
+   * that indicates from where listing should continue.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A pagination token returned from a previous call to `ListTagKeys`
+   * that indicates from where listing should continue.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagValuesRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagValuesRequest.java new file mode 100644 index 000000000000..b4af33df655f --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagValuesRequest.java @@ -0,0 +1,942 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_values.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The request message for listing TagValues for the specified TagKey.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.ListTagValuesRequest} + */ +public final class ListTagValuesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.ListTagValuesRequest) + ListTagValuesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListTagValuesRequest.newBuilder() to construct. + private ListTagValuesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListTagValuesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListTagValuesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListTagValuesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_ListTagValuesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_ListTagValuesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.ListTagValuesRequest.class, + com.google.cloud.resourcemanager.v3.ListTagValuesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Resource name for TagKey, parent of the TagValues to be listed,
+   * in the format `tagKeys/123`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Resource name for TagKey, parent of the TagValues to be listed,
+   * in the format `tagKeys/123`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * 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.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to `ListTagValues`
+   * that indicates where this listing should continue from.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to `ListTagValues`
+   * that indicates where this listing should continue from.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.ListTagValuesRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.ListTagValuesRequest other = + (com.google.cloud.resourcemanager.v3.ListTagValuesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.ListTagValuesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for listing TagValues for the specified TagKey.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.ListTagValuesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.ListTagValuesRequest) + com.google.cloud.resourcemanager.v3.ListTagValuesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_ListTagValuesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_ListTagValuesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.ListTagValuesRequest.class, + com.google.cloud.resourcemanager.v3.ListTagValuesRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.ListTagValuesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_ListTagValuesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListTagValuesRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.ListTagValuesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListTagValuesRequest build() { + com.google.cloud.resourcemanager.v3.ListTagValuesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListTagValuesRequest buildPartial() { + com.google.cloud.resourcemanager.v3.ListTagValuesRequest result = + new com.google.cloud.resourcemanager.v3.ListTagValuesRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.ListTagValuesRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.ListTagValuesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.ListTagValuesRequest other) { + if (other == com.google.cloud.resourcemanager.v3.ListTagValuesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.ListTagValuesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.ListTagValuesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Resource name for TagKey, parent of the TagValues to be listed,
+     * in the format `tagKeys/123`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Resource name for TagKey, parent of the TagValues to be listed,
+     * in the format `tagKeys/123`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Resource name for TagKey, parent of the TagValues to be listed,
+     * in the format `tagKeys/123`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name for TagKey, parent of the TagValues to be listed,
+     * in the format `tagKeys/123`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Resource name for TagKey, parent of the TagValues to be listed,
+     * in the format `tagKeys/123`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * 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.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + 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.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `ListTagValues`
+     * that indicates where this listing should continue from.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `ListTagValues`
+     * that indicates where this listing should continue from.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `ListTagValues`
+     * that indicates where this listing should continue from.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `ListTagValues`
+     * that indicates where this listing should continue from.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `ListTagValues`
+     * that indicates where this listing should continue from.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.ListTagValuesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.ListTagValuesRequest) + private static final com.google.cloud.resourcemanager.v3.ListTagValuesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.ListTagValuesRequest(); + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTagValuesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListTagValuesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListTagValuesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagValuesRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagValuesRequestOrBuilder.java new file mode 100644 index 000000000000..b778c1e1d80d --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagValuesRequestOrBuilder.java @@ -0,0 +1,98 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_values.proto + +package com.google.cloud.resourcemanager.v3; + +public interface ListTagValuesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.ListTagValuesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Resource name for TagKey, parent of the TagValues to be listed,
+   * in the format `tagKeys/123`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Resource name for TagKey, parent of the TagValues to be listed,
+   * in the format `tagKeys/123`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to `ListTagValues`
+   * that indicates where this listing should continue from.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to `ListTagValues`
+   * that indicates where this listing should continue from.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagValuesResponse.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagValuesResponse.java new file mode 100644 index 000000000000..ce305d12148c --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagValuesResponse.java @@ -0,0 +1,1169 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_values.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The ListTagValues response.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.ListTagValuesResponse} + */ +public final class ListTagValuesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.ListTagValuesResponse) + ListTagValuesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListTagValuesResponse.newBuilder() to construct. + private ListTagValuesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListTagValuesResponse() { + tagValues_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListTagValuesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListTagValuesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + tagValues_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + tagValues_.add( + input.readMessage( + com.google.cloud.resourcemanager.v3.TagValue.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + tagValues_ = java.util.Collections.unmodifiableList(tagValues_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_ListTagValuesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_ListTagValuesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.ListTagValuesResponse.class, + com.google.cloud.resourcemanager.v3.ListTagValuesResponse.Builder.class); + } + + public static final int TAG_VALUES_FIELD_NUMBER = 1; + private java.util.List tagValues_; + /** + * + * + *
+   * A possibly paginated list of TagValues that are direct descendants of
+   * the specified parent TagKey.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + @java.lang.Override + public java.util.List getTagValuesList() { + return tagValues_; + } + /** + * + * + *
+   * A possibly paginated list of TagValues that are direct descendants of
+   * the specified parent TagKey.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + @java.lang.Override + public java.util.List + getTagValuesOrBuilderList() { + return tagValues_; + } + /** + * + * + *
+   * A possibly paginated list of TagValues that are direct descendants of
+   * the specified parent TagKey.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + @java.lang.Override + public int getTagValuesCount() { + return tagValues_.size(); + } + /** + * + * + *
+   * A possibly paginated list of TagValues that are direct descendants of
+   * the specified parent TagKey.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagValue getTagValues(int index) { + return tagValues_.get(index); + } + /** + * + * + *
+   * A possibly paginated list of TagValues that are direct descendants of
+   * the specified parent TagKey.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagValueOrBuilder getTagValuesOrBuilder(int index) { + return tagValues_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * 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.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * 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.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < tagValues_.size(); i++) { + output.writeMessage(1, tagValues_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < tagValues_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, tagValues_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.ListTagValuesResponse)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.ListTagValuesResponse other = + (com.google.cloud.resourcemanager.v3.ListTagValuesResponse) obj; + + if (!getTagValuesList().equals(other.getTagValuesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getTagValuesCount() > 0) { + hash = (37 * hash) + TAG_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getTagValuesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.ListTagValuesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The ListTagValues response.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.ListTagValuesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.ListTagValuesResponse) + com.google.cloud.resourcemanager.v3.ListTagValuesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_ListTagValuesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_ListTagValuesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.ListTagValuesResponse.class, + com.google.cloud.resourcemanager.v3.ListTagValuesResponse.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.ListTagValuesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTagValuesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (tagValuesBuilder_ == null) { + tagValues_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + tagValuesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_ListTagValuesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListTagValuesResponse getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.ListTagValuesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListTagValuesResponse build() { + com.google.cloud.resourcemanager.v3.ListTagValuesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListTagValuesResponse buildPartial() { + com.google.cloud.resourcemanager.v3.ListTagValuesResponse result = + new com.google.cloud.resourcemanager.v3.ListTagValuesResponse(this); + int from_bitField0_ = bitField0_; + if (tagValuesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + tagValues_ = java.util.Collections.unmodifiableList(tagValues_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.tagValues_ = tagValues_; + } else { + result.tagValues_ = tagValuesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.ListTagValuesResponse) { + return mergeFrom((com.google.cloud.resourcemanager.v3.ListTagValuesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.ListTagValuesResponse other) { + if (other == com.google.cloud.resourcemanager.v3.ListTagValuesResponse.getDefaultInstance()) + return this; + if (tagValuesBuilder_ == null) { + if (!other.tagValues_.isEmpty()) { + if (tagValues_.isEmpty()) { + tagValues_ = other.tagValues_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTagValuesIsMutable(); + tagValues_.addAll(other.tagValues_); + } + onChanged(); + } + } else { + if (!other.tagValues_.isEmpty()) { + if (tagValuesBuilder_.isEmpty()) { + tagValuesBuilder_.dispose(); + tagValuesBuilder_ = null; + tagValues_ = other.tagValues_; + bitField0_ = (bitField0_ & ~0x00000001); + tagValuesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTagValuesFieldBuilder() + : null; + } else { + tagValuesBuilder_.addAllMessages(other.tagValues_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.ListTagValuesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.ListTagValuesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List tagValues_ = + java.util.Collections.emptyList(); + + private void ensureTagValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + tagValues_ = + new java.util.ArrayList(tagValues_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.resourcemanager.v3.TagValue, + com.google.cloud.resourcemanager.v3.TagValue.Builder, + com.google.cloud.resourcemanager.v3.TagValueOrBuilder> + tagValuesBuilder_; + + /** + * + * + *
+     * A possibly paginated list of TagValues that are direct descendants of
+     * the specified parent TagKey.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + public java.util.List getTagValuesList() { + if (tagValuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(tagValues_); + } else { + return tagValuesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A possibly paginated list of TagValues that are direct descendants of
+     * the specified parent TagKey.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + public int getTagValuesCount() { + if (tagValuesBuilder_ == null) { + return tagValues_.size(); + } else { + return tagValuesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A possibly paginated list of TagValues that are direct descendants of
+     * the specified parent TagKey.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + public com.google.cloud.resourcemanager.v3.TagValue getTagValues(int index) { + if (tagValuesBuilder_ == null) { + return tagValues_.get(index); + } else { + return tagValuesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A possibly paginated list of TagValues that are direct descendants of
+     * the specified parent TagKey.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + public Builder setTagValues(int index, com.google.cloud.resourcemanager.v3.TagValue value) { + if (tagValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagValuesIsMutable(); + tagValues_.set(index, value); + onChanged(); + } else { + tagValuesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of TagValues that are direct descendants of
+     * the specified parent TagKey.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + public Builder setTagValues( + int index, com.google.cloud.resourcemanager.v3.TagValue.Builder builderForValue) { + if (tagValuesBuilder_ == null) { + ensureTagValuesIsMutable(); + tagValues_.set(index, builderForValue.build()); + onChanged(); + } else { + tagValuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of TagValues that are direct descendants of
+     * the specified parent TagKey.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + public Builder addTagValues(com.google.cloud.resourcemanager.v3.TagValue value) { + if (tagValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagValuesIsMutable(); + tagValues_.add(value); + onChanged(); + } else { + tagValuesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of TagValues that are direct descendants of
+     * the specified parent TagKey.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + public Builder addTagValues(int index, com.google.cloud.resourcemanager.v3.TagValue value) { + if (tagValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTagValuesIsMutable(); + tagValues_.add(index, value); + onChanged(); + } else { + tagValuesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of TagValues that are direct descendants of
+     * the specified parent TagKey.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + public Builder addTagValues( + com.google.cloud.resourcemanager.v3.TagValue.Builder builderForValue) { + if (tagValuesBuilder_ == null) { + ensureTagValuesIsMutable(); + tagValues_.add(builderForValue.build()); + onChanged(); + } else { + tagValuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of TagValues that are direct descendants of
+     * the specified parent TagKey.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + public Builder addTagValues( + int index, com.google.cloud.resourcemanager.v3.TagValue.Builder builderForValue) { + if (tagValuesBuilder_ == null) { + ensureTagValuesIsMutable(); + tagValues_.add(index, builderForValue.build()); + onChanged(); + } else { + tagValuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of TagValues that are direct descendants of
+     * the specified parent TagKey.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + public Builder addAllTagValues( + java.lang.Iterable values) { + if (tagValuesBuilder_ == null) { + ensureTagValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tagValues_); + onChanged(); + } else { + tagValuesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of TagValues that are direct descendants of
+     * the specified parent TagKey.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + public Builder clearTagValues() { + if (tagValuesBuilder_ == null) { + tagValues_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + tagValuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of TagValues that are direct descendants of
+     * the specified parent TagKey.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + public Builder removeTagValues(int index) { + if (tagValuesBuilder_ == null) { + ensureTagValuesIsMutable(); + tagValues_.remove(index); + onChanged(); + } else { + tagValuesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A possibly paginated list of TagValues that are direct descendants of
+     * the specified parent TagKey.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + public com.google.cloud.resourcemanager.v3.TagValue.Builder getTagValuesBuilder(int index) { + return getTagValuesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A possibly paginated list of TagValues that are direct descendants of
+     * the specified parent TagKey.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + public com.google.cloud.resourcemanager.v3.TagValueOrBuilder getTagValuesOrBuilder(int index) { + if (tagValuesBuilder_ == null) { + return tagValues_.get(index); + } else { + return tagValuesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A possibly paginated list of TagValues that are direct descendants of
+     * the specified parent TagKey.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + public java.util.List + getTagValuesOrBuilderList() { + if (tagValuesBuilder_ != null) { + return tagValuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(tagValues_); + } + } + /** + * + * + *
+     * A possibly paginated list of TagValues that are direct descendants of
+     * the specified parent TagKey.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + public com.google.cloud.resourcemanager.v3.TagValue.Builder addTagValuesBuilder() { + return getTagValuesFieldBuilder() + .addBuilder(com.google.cloud.resourcemanager.v3.TagValue.getDefaultInstance()); + } + /** + * + * + *
+     * A possibly paginated list of TagValues that are direct descendants of
+     * the specified parent TagKey.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + public com.google.cloud.resourcemanager.v3.TagValue.Builder addTagValuesBuilder(int index) { + return getTagValuesFieldBuilder() + .addBuilder(index, com.google.cloud.resourcemanager.v3.TagValue.getDefaultInstance()); + } + /** + * + * + *
+     * A possibly paginated list of TagValues that are direct descendants of
+     * the specified parent TagKey.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + public java.util.List + getTagValuesBuilderList() { + return getTagValuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.resourcemanager.v3.TagValue, + com.google.cloud.resourcemanager.v3.TagValue.Builder, + com.google.cloud.resourcemanager.v3.TagValueOrBuilder> + getTagValuesFieldBuilder() { + if (tagValuesBuilder_ == null) { + tagValuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.resourcemanager.v3.TagValue, + com.google.cloud.resourcemanager.v3.TagValue.Builder, + com.google.cloud.resourcemanager.v3.TagValueOrBuilder>( + tagValues_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + tagValues_ = null; + } + return tagValuesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * 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.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + 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.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + 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.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.ListTagValuesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.ListTagValuesResponse) + private static final com.google.cloud.resourcemanager.v3.ListTagValuesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.ListTagValuesResponse(); + } + + public static com.google.cloud.resourcemanager.v3.ListTagValuesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTagValuesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListTagValuesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ListTagValuesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagValuesResponseOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagValuesResponseOrBuilder.java new file mode 100644 index 000000000000..af9237c4b11d --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ListTagValuesResponseOrBuilder.java @@ -0,0 +1,111 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_values.proto + +package com.google.cloud.resourcemanager.v3; + +public interface ListTagValuesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.ListTagValuesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A possibly paginated list of TagValues that are direct descendants of
+   * the specified parent TagKey.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + java.util.List getTagValuesList(); + /** + * + * + *
+   * A possibly paginated list of TagValues that are direct descendants of
+   * the specified parent TagKey.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + com.google.cloud.resourcemanager.v3.TagValue getTagValues(int index); + /** + * + * + *
+   * A possibly paginated list of TagValues that are direct descendants of
+   * the specified parent TagKey.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + int getTagValuesCount(); + /** + * + * + *
+   * A possibly paginated list of TagValues that are direct descendants of
+   * the specified parent TagKey.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + java.util.List + getTagValuesOrBuilderList(); + /** + * + * + *
+   * A possibly paginated list of TagValues that are direct descendants of
+   * the specified parent TagKey.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.TagValue tag_values = 1; + */ + com.google.cloud.resourcemanager.v3.TagValueOrBuilder getTagValuesOrBuilder(int index); + + /** + * + * + *
+   * 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.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * 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.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveFolderMetadata.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveFolderMetadata.java new file mode 100644 index 000000000000..ba81982a2527 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveFolderMetadata.java @@ -0,0 +1,995 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * Metadata pertaining to the folder move process.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.MoveFolderMetadata} + */ +public final class MoveFolderMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.MoveFolderMetadata) + MoveFolderMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use MoveFolderMetadata.newBuilder() to construct. + private MoveFolderMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MoveFolderMetadata() { + displayName_ = ""; + sourceParent_ = ""; + destinationParent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MoveFolderMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private MoveFolderMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + sourceParent_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + destinationParent_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_MoveFolderMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_MoveFolderMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.MoveFolderMetadata.class, + com.google.cloud.resourcemanager.v3.MoveFolderMetadata.Builder.class); + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * The display name of the folder.
+   * 
+ * + * string display_name = 1; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * The display name of the folder.
+   * 
+ * + * string display_name = 1; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_PARENT_FIELD_NUMBER = 2; + private volatile java.lang.Object sourceParent_; + /** + * + * + *
+   * The resource name of the folder's parent.
+   * 
+ * + * string source_parent = 2; + * + * @return The sourceParent. + */ + @java.lang.Override + public java.lang.String getSourceParent() { + java.lang.Object ref = sourceParent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceParent_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the folder's parent.
+   * 
+ * + * string source_parent = 2; + * + * @return The bytes for sourceParent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceParentBytes() { + java.lang.Object ref = sourceParent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceParent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESTINATION_PARENT_FIELD_NUMBER = 3; + private volatile java.lang.Object destinationParent_; + /** + * + * + *
+   * The resource name of the folder or organization to move the folder to.
+   * 
+ * + * string destination_parent = 3; + * + * @return The destinationParent. + */ + @java.lang.Override + public java.lang.String getDestinationParent() { + java.lang.Object ref = destinationParent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destinationParent_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the folder or organization to move the folder to.
+   * 
+ * + * string destination_parent = 3; + * + * @return The bytes for destinationParent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDestinationParentBytes() { + java.lang.Object ref = destinationParent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationParent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, displayName_); + } + if (!getSourceParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, sourceParent_); + } + if (!getDestinationParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, destinationParent_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, displayName_); + } + if (!getSourceParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, sourceParent_); + } + if (!getDestinationParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, destinationParent_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.MoveFolderMetadata)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.MoveFolderMetadata other = + (com.google.cloud.resourcemanager.v3.MoveFolderMetadata) obj; + + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getSourceParent().equals(other.getSourceParent())) return false; + if (!getDestinationParent().equals(other.getDestinationParent())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + SOURCE_PARENT_FIELD_NUMBER; + hash = (53 * hash) + getSourceParent().hashCode(); + hash = (37 * hash) + DESTINATION_PARENT_FIELD_NUMBER; + hash = (53 * hash) + getDestinationParent().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.MoveFolderMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Metadata pertaining to the folder move process.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.MoveFolderMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.MoveFolderMetadata) + com.google.cloud.resourcemanager.v3.MoveFolderMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_MoveFolderMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_MoveFolderMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.MoveFolderMetadata.class, + com.google.cloud.resourcemanager.v3.MoveFolderMetadata.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.MoveFolderMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + displayName_ = ""; + + sourceParent_ = ""; + + destinationParent_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_MoveFolderMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.MoveFolderMetadata getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.MoveFolderMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.MoveFolderMetadata build() { + com.google.cloud.resourcemanager.v3.MoveFolderMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.MoveFolderMetadata buildPartial() { + com.google.cloud.resourcemanager.v3.MoveFolderMetadata result = + new com.google.cloud.resourcemanager.v3.MoveFolderMetadata(this); + result.displayName_ = displayName_; + result.sourceParent_ = sourceParent_; + result.destinationParent_ = destinationParent_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.MoveFolderMetadata) { + return mergeFrom((com.google.cloud.resourcemanager.v3.MoveFolderMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.MoveFolderMetadata other) { + if (other == com.google.cloud.resourcemanager.v3.MoveFolderMetadata.getDefaultInstance()) + return this; + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getSourceParent().isEmpty()) { + sourceParent_ = other.sourceParent_; + onChanged(); + } + if (!other.getDestinationParent().isEmpty()) { + destinationParent_ = other.destinationParent_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.MoveFolderMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.MoveFolderMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * The display name of the folder.
+     * 
+ * + * string display_name = 1; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The display name of the folder.
+     * 
+ * + * string display_name = 1; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The display name of the folder.
+     * 
+ * + * string display_name = 1; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The display name of the folder.
+     * 
+ * + * string display_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The display name of the folder.
+     * 
+ * + * string display_name = 1; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object sourceParent_ = ""; + /** + * + * + *
+     * The resource name of the folder's parent.
+     * 
+ * + * string source_parent = 2; + * + * @return The sourceParent. + */ + public java.lang.String getSourceParent() { + java.lang.Object ref = sourceParent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceParent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the folder's parent.
+     * 
+ * + * string source_parent = 2; + * + * @return The bytes for sourceParent. + */ + public com.google.protobuf.ByteString getSourceParentBytes() { + java.lang.Object ref = sourceParent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceParent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the folder's parent.
+     * 
+ * + * string source_parent = 2; + * + * @param value The sourceParent to set. + * @return This builder for chaining. + */ + public Builder setSourceParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sourceParent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the folder's parent.
+     * 
+ * + * string source_parent = 2; + * + * @return This builder for chaining. + */ + public Builder clearSourceParent() { + + sourceParent_ = getDefaultInstance().getSourceParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the folder's parent.
+     * 
+ * + * string source_parent = 2; + * + * @param value The bytes for sourceParent to set. + * @return This builder for chaining. + */ + public Builder setSourceParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sourceParent_ = value; + onChanged(); + return this; + } + + private java.lang.Object destinationParent_ = ""; + /** + * + * + *
+     * The resource name of the folder or organization to move the folder to.
+     * 
+ * + * string destination_parent = 3; + * + * @return The destinationParent. + */ + public java.lang.String getDestinationParent() { + java.lang.Object ref = destinationParent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destinationParent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the folder or organization to move the folder to.
+     * 
+ * + * string destination_parent = 3; + * + * @return The bytes for destinationParent. + */ + public com.google.protobuf.ByteString getDestinationParentBytes() { + java.lang.Object ref = destinationParent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationParent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the folder or organization to move the folder to.
+     * 
+ * + * string destination_parent = 3; + * + * @param value The destinationParent to set. + * @return This builder for chaining. + */ + public Builder setDestinationParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + destinationParent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the folder or organization to move the folder to.
+     * 
+ * + * string destination_parent = 3; + * + * @return This builder for chaining. + */ + public Builder clearDestinationParent() { + + destinationParent_ = getDefaultInstance().getDestinationParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the folder or organization to move the folder to.
+     * 
+ * + * string destination_parent = 3; + * + * @param value The bytes for destinationParent to set. + * @return This builder for chaining. + */ + public Builder setDestinationParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + destinationParent_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.MoveFolderMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.MoveFolderMetadata) + private static final com.google.cloud.resourcemanager.v3.MoveFolderMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.MoveFolderMetadata(); + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MoveFolderMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MoveFolderMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.MoveFolderMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveFolderMetadataOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveFolderMetadataOrBuilder.java new file mode 100644 index 000000000000..cbdc7fcfc9a1 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveFolderMetadataOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +public interface MoveFolderMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.MoveFolderMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The display name of the folder.
+   * 
+ * + * string display_name = 1; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * The display name of the folder.
+   * 
+ * + * string display_name = 1; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * The resource name of the folder's parent.
+   * 
+ * + * string source_parent = 2; + * + * @return The sourceParent. + */ + java.lang.String getSourceParent(); + /** + * + * + *
+   * The resource name of the folder's parent.
+   * 
+ * + * string source_parent = 2; + * + * @return The bytes for sourceParent. + */ + com.google.protobuf.ByteString getSourceParentBytes(); + + /** + * + * + *
+   * The resource name of the folder or organization to move the folder to.
+   * 
+ * + * string destination_parent = 3; + * + * @return The destinationParent. + */ + java.lang.String getDestinationParent(); + /** + * + * + *
+   * The resource name of the folder or organization to move the folder to.
+   * 
+ * + * string destination_parent = 3; + * + * @return The bytes for destinationParent. + */ + com.google.protobuf.ByteString getDestinationParentBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveFolderRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveFolderRequest.java new file mode 100644 index 000000000000..09665efe6138 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveFolderRequest.java @@ -0,0 +1,865 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The MoveFolder request message.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.MoveFolderRequest} + */ +public final class MoveFolderRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.MoveFolderRequest) + MoveFolderRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use MoveFolderRequest.newBuilder() to construct. + private MoveFolderRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MoveFolderRequest() { + name_ = ""; + destinationParent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MoveFolderRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private MoveFolderRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + destinationParent_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_MoveFolderRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_MoveFolderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.MoveFolderRequest.class, + com.google.cloud.resourcemanager.v3.MoveFolderRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the Folder to move.
+   * Must be of the form folders/{folder_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the Folder to move.
+   * Must be of the form folders/{folder_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESTINATION_PARENT_FIELD_NUMBER = 2; + private volatile java.lang.Object 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}`.
+   * 
+ * + * + * string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The destinationParent. + */ + @java.lang.Override + public java.lang.String getDestinationParent() { + java.lang.Object ref = destinationParent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destinationParent_ = s; + return s; + } + } + /** + * + * + *
+   * 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}`.
+   * 
+ * + * + * string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for destinationParent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDestinationParentBytes() { + java.lang.Object ref = destinationParent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationParent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDestinationParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, destinationParent_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDestinationParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, destinationParent_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.MoveFolderRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.MoveFolderRequest other = + (com.google.cloud.resourcemanager.v3.MoveFolderRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDestinationParent().equals(other.getDestinationParent())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESTINATION_PARENT_FIELD_NUMBER; + hash = (53 * hash) + getDestinationParent().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.MoveFolderRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The MoveFolder request message.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.MoveFolderRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.MoveFolderRequest) + com.google.cloud.resourcemanager.v3.MoveFolderRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_MoveFolderRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_MoveFolderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.MoveFolderRequest.class, + com.google.cloud.resourcemanager.v3.MoveFolderRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.MoveFolderRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + destinationParent_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_MoveFolderRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.MoveFolderRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.MoveFolderRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.MoveFolderRequest build() { + com.google.cloud.resourcemanager.v3.MoveFolderRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.MoveFolderRequest buildPartial() { + com.google.cloud.resourcemanager.v3.MoveFolderRequest result = + new com.google.cloud.resourcemanager.v3.MoveFolderRequest(this); + result.name_ = name_; + result.destinationParent_ = destinationParent_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.MoveFolderRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.MoveFolderRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.MoveFolderRequest other) { + if (other == com.google.cloud.resourcemanager.v3.MoveFolderRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDestinationParent().isEmpty()) { + destinationParent_ = other.destinationParent_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.MoveFolderRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.MoveFolderRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the Folder to move.
+     * Must be of the form folders/{folder_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Folder to move.
+     * Must be of the form folders/{folder_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Folder to move.
+     * Must be of the form folders/{folder_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Folder to move.
+     * Must be of the form folders/{folder_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Folder to move.
+     * Must be of the form folders/{folder_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object 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}`.
+     * 
+ * + * + * string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The destinationParent. + */ + public java.lang.String getDestinationParent() { + java.lang.Object ref = destinationParent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destinationParent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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}`.
+     * 
+ * + * + * string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for destinationParent. + */ + public com.google.protobuf.ByteString getDestinationParentBytes() { + java.lang.Object ref = destinationParent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationParent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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}`.
+     * 
+ * + * + * string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The destinationParent to set. + * @return This builder for chaining. + */ + public Builder setDestinationParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + destinationParent_ = value; + onChanged(); + 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}`.
+     * 
+ * + * + * string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearDestinationParent() { + + destinationParent_ = getDefaultInstance().getDestinationParent(); + onChanged(); + 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}`.
+     * 
+ * + * + * string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for destinationParent to set. + * @return This builder for chaining. + */ + public Builder setDestinationParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + destinationParent_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.MoveFolderRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.MoveFolderRequest) + private static final com.google.cloud.resourcemanager.v3.MoveFolderRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.MoveFolderRequest(); + } + + public static com.google.cloud.resourcemanager.v3.MoveFolderRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MoveFolderRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MoveFolderRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.MoveFolderRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveFolderRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveFolderRequestOrBuilder.java new file mode 100644 index 000000000000..9df41df49662 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveFolderRequestOrBuilder.java @@ -0,0 +1,89 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +public interface MoveFolderRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.MoveFolderRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the Folder to move.
+   * Must be of the form folders/{folder_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the Folder to move.
+   * Must be of the form folders/{folder_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * 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}`.
+   * 
+ * + * + * string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The destinationParent. + */ + java.lang.String getDestinationParent(); + /** + * + * + *
+   * 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}`.
+   * 
+ * + * + * string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for destinationParent. + */ + com.google.protobuf.ByteString getDestinationParentBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveProjectMetadata.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveProjectMetadata.java new file mode 100644 index 000000000000..c97edd82d5a0 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveProjectMetadata.java @@ -0,0 +1,459 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * A status object which is used as the `metadata` field for the Operation
+ * returned by MoveProject.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.MoveProjectMetadata} + */ +public final class MoveProjectMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.MoveProjectMetadata) + MoveProjectMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use MoveProjectMetadata.newBuilder() to construct. + private MoveProjectMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MoveProjectMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MoveProjectMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private MoveProjectMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_MoveProjectMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_MoveProjectMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.MoveProjectMetadata.class, + com.google.cloud.resourcemanager.v3.MoveProjectMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.MoveProjectMetadata)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.MoveProjectMetadata other = + (com.google.cloud.resourcemanager.v3.MoveProjectMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.MoveProjectMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A status object which is used as the `metadata` field for the Operation
+   * returned by MoveProject.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.MoveProjectMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.MoveProjectMetadata) + com.google.cloud.resourcemanager.v3.MoveProjectMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_MoveProjectMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_MoveProjectMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.MoveProjectMetadata.class, + com.google.cloud.resourcemanager.v3.MoveProjectMetadata.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.MoveProjectMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_MoveProjectMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.MoveProjectMetadata getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.MoveProjectMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.MoveProjectMetadata build() { + com.google.cloud.resourcemanager.v3.MoveProjectMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.MoveProjectMetadata buildPartial() { + com.google.cloud.resourcemanager.v3.MoveProjectMetadata result = + new com.google.cloud.resourcemanager.v3.MoveProjectMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.MoveProjectMetadata) { + return mergeFrom((com.google.cloud.resourcemanager.v3.MoveProjectMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.MoveProjectMetadata other) { + if (other == com.google.cloud.resourcemanager.v3.MoveProjectMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.MoveProjectMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.MoveProjectMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.MoveProjectMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.MoveProjectMetadata) + private static final com.google.cloud.resourcemanager.v3.MoveProjectMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.MoveProjectMetadata(); + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MoveProjectMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MoveProjectMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.MoveProjectMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveProjectMetadataOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveProjectMetadataOrBuilder.java new file mode 100644 index 000000000000..ff9124c2cd78 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveProjectMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +public interface MoveProjectMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.MoveProjectMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveProjectRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveProjectRequest.java new file mode 100644 index 000000000000..b3337f0af315 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveProjectRequest.java @@ -0,0 +1,848 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The request sent to
+ * [MoveProject][google.cloud.resourcemanager.v3.Projects.MoveProject]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.MoveProjectRequest} + */ +public final class MoveProjectRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.MoveProjectRequest) + MoveProjectRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use MoveProjectRequest.newBuilder() to construct. + private MoveProjectRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MoveProjectRequest() { + name_ = ""; + destinationParent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MoveProjectRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private MoveProjectRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + destinationParent_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_MoveProjectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_MoveProjectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.MoveProjectRequest.class, + com.google.cloud.resourcemanager.v3.MoveProjectRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the project to move.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the project to move.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESTINATION_PARENT_FIELD_NUMBER = 2; + private volatile java.lang.Object destinationParent_; + /** + * + * + *
+   * Required. The new parent to move the Project under.
+   * 
+ * + * + * string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The destinationParent. + */ + @java.lang.Override + public java.lang.String getDestinationParent() { + java.lang.Object ref = destinationParent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destinationParent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The new parent to move the Project under.
+   * 
+ * + * + * string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for destinationParent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDestinationParentBytes() { + java.lang.Object ref = destinationParent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationParent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDestinationParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, destinationParent_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDestinationParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, destinationParent_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.MoveProjectRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.MoveProjectRequest other = + (com.google.cloud.resourcemanager.v3.MoveProjectRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDestinationParent().equals(other.getDestinationParent())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESTINATION_PARENT_FIELD_NUMBER; + hash = (53 * hash) + getDestinationParent().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.MoveProjectRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request sent to
+   * [MoveProject][google.cloud.resourcemanager.v3.Projects.MoveProject]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.MoveProjectRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.MoveProjectRequest) + com.google.cloud.resourcemanager.v3.MoveProjectRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_MoveProjectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_MoveProjectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.MoveProjectRequest.class, + com.google.cloud.resourcemanager.v3.MoveProjectRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.MoveProjectRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + destinationParent_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_MoveProjectRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.MoveProjectRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.MoveProjectRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.MoveProjectRequest build() { + com.google.cloud.resourcemanager.v3.MoveProjectRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.MoveProjectRequest buildPartial() { + com.google.cloud.resourcemanager.v3.MoveProjectRequest result = + new com.google.cloud.resourcemanager.v3.MoveProjectRequest(this); + result.name_ = name_; + result.destinationParent_ = destinationParent_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.MoveProjectRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.MoveProjectRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.MoveProjectRequest other) { + if (other == com.google.cloud.resourcemanager.v3.MoveProjectRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDestinationParent().isEmpty()) { + destinationParent_ = other.destinationParent_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.MoveProjectRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.MoveProjectRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the project to move.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the project to move.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the project to move.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the project to move.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the project to move.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object destinationParent_ = ""; + /** + * + * + *
+     * Required. The new parent to move the Project under.
+     * 
+ * + * + * string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The destinationParent. + */ + public java.lang.String getDestinationParent() { + java.lang.Object ref = destinationParent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destinationParent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The new parent to move the Project under.
+     * 
+ * + * + * string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for destinationParent. + */ + public com.google.protobuf.ByteString getDestinationParentBytes() { + java.lang.Object ref = destinationParent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationParent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The new parent to move the Project under.
+     * 
+ * + * + * string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The destinationParent to set. + * @return This builder for chaining. + */ + public Builder setDestinationParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + destinationParent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The new parent to move the Project under.
+     * 
+ * + * + * string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearDestinationParent() { + + destinationParent_ = getDefaultInstance().getDestinationParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The new parent to move the Project under.
+     * 
+ * + * + * string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for destinationParent to set. + * @return This builder for chaining. + */ + public Builder setDestinationParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + destinationParent_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.MoveProjectRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.MoveProjectRequest) + private static final com.google.cloud.resourcemanager.v3.MoveProjectRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.MoveProjectRequest(); + } + + public static com.google.cloud.resourcemanager.v3.MoveProjectRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MoveProjectRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MoveProjectRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.MoveProjectRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveProjectRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveProjectRequestOrBuilder.java new file mode 100644 index 000000000000..adfaaf150ab2 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/MoveProjectRequestOrBuilder.java @@ -0,0 +1,83 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +public interface MoveProjectRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.MoveProjectRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the project to move.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the project to move.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The new parent to move the Project under.
+   * 
+ * + * + * string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The destinationParent. + */ + java.lang.String getDestinationParent(); + /** + * + * + *
+   * Required. The new parent to move the Project under.
+   * 
+ * + * + * string destination_parent = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for destinationParent. + */ + com.google.protobuf.ByteString getDestinationParentBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/Organization.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/Organization.java new file mode 100644 index 000000000000..8050dd0c5184 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/Organization.java @@ -0,0 +1,2560 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/organizations.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The root node in the resource hierarchy to which a particular entity's
+ * (a company, for example) resources belong.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.Organization} + */ +public final class Organization extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.Organization) + OrganizationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Organization.newBuilder() to construct. + private Organization(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Organization() { + name_ = ""; + displayName_ = ""; + state_ = 0; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Organization(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Organization( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ownerCase_ = 3; + owner_ = s; + break; + } + case 32: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 58: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (deleteTime_ != null) { + subBuilder = deleteTime_.toBuilder(); + } + deleteTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deleteTime_); + deleteTime_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + etag_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_Organization_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_Organization_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.Organization.class, + com.google.cloud.resourcemanager.v3.Organization.Builder.class); + } + + /** + * + * + *
+   * Organization lifecycle states.
+   * 
+ * + * Protobuf enum {@code google.cloud.resourcemanager.v3.Organization.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified state.  This is only useful for distinguishing unset values.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The normal and active state.
+     * 
+ * + * ACTIVE = 1; + */ + ACTIVE(1), + /** + * + * + *
+     * The organization has been marked for deletion by the user.
+     * 
+ * + * DELETE_REQUESTED = 2; + */ + DELETE_REQUESTED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified state.  This is only useful for distinguishing unset values.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The normal and active state.
+     * 
+ * + * ACTIVE = 1; + */ + public static final int ACTIVE_VALUE = 1; + /** + * + * + *
+     * The organization has been marked for deletion by the user.
+     * 
+ * + * DELETE_REQUESTED = 2; + */ + public static final int DELETE_REQUESTED_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return ACTIVE; + case 2: + return DELETE_REQUESTED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.Organization.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.resourcemanager.v3.Organization.State) + } + + private int ownerCase_ = 0; + private java.lang.Object owner_; + + public enum OwnerCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + DIRECTORY_CUSTOMER_ID(3), + OWNER_NOT_SET(0); + private final int value; + + private OwnerCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OwnerCase valueOf(int value) { + return forNumber(value); + } + + public static OwnerCase forNumber(int value) { + switch (value) { + case 3: + return DIRECTORY_CUSTOMER_ID; + case 0: + return OWNER_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public OwnerCase getOwnerCase() { + return OwnerCase.forNumber(ownerCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object 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".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * 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".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * 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.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * 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.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DIRECTORY_CUSTOMER_ID_FIELD_NUMBER = 3; + /** + * + * + *
+   * Immutable. The G Suite / Workspace customer id used in the Directory API.
+   * 
+ * + * string directory_customer_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return Whether the directoryCustomerId field is set. + */ + public boolean hasDirectoryCustomerId() { + return ownerCase_ == 3; + } + /** + * + * + *
+   * Immutable. The G Suite / Workspace customer id used in the Directory API.
+   * 
+ * + * string directory_customer_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The directoryCustomerId. + */ + public java.lang.String getDirectoryCustomerId() { + java.lang.Object ref = ""; + if (ownerCase_ == 3) { + ref = owner_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (ownerCase_ == 3) { + owner_ = s; + } + return s; + } + } + /** + * + * + *
+   * Immutable. The G Suite / Workspace customer id used in the Directory API.
+   * 
+ * + * string directory_customer_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for directoryCustomerId. + */ + public com.google.protobuf.ByteString getDirectoryCustomerIdBytes() { + java.lang.Object ref = ""; + if (ownerCase_ == 3) { + ref = owner_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (ownerCase_ == 3) { + owner_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 4; + private int state_; + /** + * + * + *
+   * Output only. The organization's current lifecycle state.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Organization.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. The organization's current lifecycle state.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Organization.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Organization.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.resourcemanager.v3.Organization.State result = + com.google.cloud.resourcemanager.v3.Organization.State.valueOf(state_); + return result == null + ? com.google.cloud.resourcemanager.v3.Organization.State.UNRECOGNIZED + : result; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Timestamp when the Organization was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Timestamp when the Organization was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Timestamp when the Organization was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Timestamp when the Organization was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Timestamp when the Organization was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Timestamp when the Organization was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int DELETE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp deleteTime_; + /** + * + * + *
+   * Output only. Timestamp when the Organization was requested for deletion.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + @java.lang.Override + public boolean hasDeleteTime() { + return deleteTime_ != null; + } + /** + * + * + *
+   * Output only. Timestamp when the Organization was requested for deletion.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getDeleteTime() { + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; + } + /** + * + * + *
+   * Output only. Timestamp when the Organization was requested for deletion.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + return getDeleteTime(); + } + + public static final int ETAG_FIELD_NUMBER = 8; + private volatile java.lang.Object 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.
+   * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * 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.
+   * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (ownerCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, owner_); + } + if (state_ + != com.google.cloud.resourcemanager.v3.Organization.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, state_); + } + if (createTime_ != null) { + output.writeMessage(5, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(6, getUpdateTime()); + } + if (deleteTime_ != null) { + output.writeMessage(7, getDeleteTime()); + } + if (!getEtagBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, etag_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (ownerCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, owner_); + } + if (state_ + != com.google.cloud.resourcemanager.v3.Organization.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, state_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getUpdateTime()); + } + if (deleteTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getDeleteTime()); + } + if (!getEtagBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, etag_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.Organization)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.Organization other = + (com.google.cloud.resourcemanager.v3.Organization) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (state_ != other.state_) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasDeleteTime() != other.hasDeleteTime()) return false; + if (hasDeleteTime()) { + if (!getDeleteTime().equals(other.getDeleteTime())) return false; + } + if (!getEtag().equals(other.getEtag())) return false; + if (!getOwnerCase().equals(other.getOwnerCase())) return false; + switch (ownerCase_) { + case 3: + if (!getDirectoryCustomerId().equals(other.getDirectoryCustomerId())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasDeleteTime()) { + hash = (37 * hash) + DELETE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDeleteTime().hashCode(); + } + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + switch (ownerCase_) { + case 3: + hash = (37 * hash) + DIRECTORY_CUSTOMER_ID_FIELD_NUMBER; + hash = (53 * hash) + getDirectoryCustomerId().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.Organization parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.Organization parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.Organization parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.Organization parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.Organization parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.Organization parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.Organization parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.Organization parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.Organization parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.Organization parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.Organization parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.Organization parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.resourcemanager.v3.Organization prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The root node in the resource hierarchy to which a particular entity's
+   * (a company, for example) resources belong.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.Organization} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.Organization) + com.google.cloud.resourcemanager.v3.OrganizationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_Organization_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_Organization_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.Organization.class, + com.google.cloud.resourcemanager.v3.Organization.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.Organization.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + state_ = 0; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + if (deleteTimeBuilder_ == null) { + deleteTime_ = null; + } else { + deleteTime_ = null; + deleteTimeBuilder_ = null; + } + etag_ = ""; + + ownerCase_ = 0; + owner_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_Organization_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Organization getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.Organization.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Organization build() { + com.google.cloud.resourcemanager.v3.Organization result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Organization buildPartial() { + com.google.cloud.resourcemanager.v3.Organization result = + new com.google.cloud.resourcemanager.v3.Organization(this); + result.name_ = name_; + result.displayName_ = displayName_; + if (ownerCase_ == 3) { + result.owner_ = owner_; + } + result.state_ = state_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + if (deleteTimeBuilder_ == null) { + result.deleteTime_ = deleteTime_; + } else { + result.deleteTime_ = deleteTimeBuilder_.build(); + } + result.etag_ = etag_; + result.ownerCase_ = ownerCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.Organization) { + return mergeFrom((com.google.cloud.resourcemanager.v3.Organization) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.Organization other) { + if (other == com.google.cloud.resourcemanager.v3.Organization.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasDeleteTime()) { + mergeDeleteTime(other.getDeleteTime()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + onChanged(); + } + switch (other.getOwnerCase()) { + case DIRECTORY_CUSTOMER_ID: + { + ownerCase_ = 3; + owner_ = other.owner_; + onChanged(); + break; + } + case OWNER_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.Organization parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.resourcemanager.v3.Organization) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int ownerCase_ = 0; + private java.lang.Object owner_; + + public OwnerCase getOwnerCase() { + return OwnerCase.forNumber(ownerCase_); + } + + public Builder clearOwner() { + ownerCase_ = 0; + owner_ = null; + onChanged(); + return this; + } + + private java.lang.Object 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".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * 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.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + 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.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + 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.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Immutable. The G Suite / Workspace customer id used in the Directory API.
+     * 
+ * + * string directory_customer_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return Whether the directoryCustomerId field is set. + */ + @java.lang.Override + public boolean hasDirectoryCustomerId() { + return ownerCase_ == 3; + } + /** + * + * + *
+     * Immutable. The G Suite / Workspace customer id used in the Directory API.
+     * 
+ * + * string directory_customer_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The directoryCustomerId. + */ + @java.lang.Override + public java.lang.String getDirectoryCustomerId() { + java.lang.Object ref = ""; + if (ownerCase_ == 3) { + ref = owner_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (ownerCase_ == 3) { + owner_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. The G Suite / Workspace customer id used in the Directory API.
+     * 
+ * + * string directory_customer_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for directoryCustomerId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDirectoryCustomerIdBytes() { + java.lang.Object ref = ""; + if (ownerCase_ == 3) { + ref = owner_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (ownerCase_ == 3) { + owner_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. The G Suite / Workspace customer id used in the Directory API.
+     * 
+ * + * string directory_customer_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The directoryCustomerId to set. + * @return This builder for chaining. + */ + public Builder setDirectoryCustomerId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ownerCase_ = 3; + owner_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The G Suite / Workspace customer id used in the Directory API.
+     * 
+ * + * string directory_customer_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearDirectoryCustomerId() { + if (ownerCase_ == 3) { + ownerCase_ = 0; + owner_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Immutable. The G Suite / Workspace customer id used in the Directory API.
+     * 
+ * + * string directory_customer_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for directoryCustomerId to set. + * @return This builder for chaining. + */ + public Builder setDirectoryCustomerIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ownerCase_ = 3; + owner_ = value; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The organization's current lifecycle state.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Organization.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. The organization's current lifecycle state.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Organization.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The organization's current lifecycle state.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Organization.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Organization.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.resourcemanager.v3.Organization.State result = + com.google.cloud.resourcemanager.v3.Organization.State.valueOf(state_); + return result == null + ? com.google.cloud.resourcemanager.v3.Organization.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The organization's current lifecycle state.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Organization.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.resourcemanager.v3.Organization.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The organization's current lifecycle state.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Organization.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Timestamp when the Organization was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. Timestamp when the Organization was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Timestamp when the Organization was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the Organization was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the Organization was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the Organization was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the Organization was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Timestamp when the Organization was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Timestamp when the Organization was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Timestamp when the Organization was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. Timestamp when the Organization was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Timestamp when the Organization was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the Organization was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the Organization was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the Organization was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the Organization was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Timestamp when the Organization was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Timestamp when the Organization was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.Timestamp deleteTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + deleteTimeBuilder_; + /** + * + * + *
+     * Output only. Timestamp when the Organization was requested for deletion.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + public boolean hasDeleteTime() { + return deleteTimeBuilder_ != null || deleteTime_ != null; + } + /** + * + * + *
+     * Output only. Timestamp when the Organization was requested for deletion.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + public com.google.protobuf.Timestamp getDeleteTime() { + if (deleteTimeBuilder_ == null) { + return deleteTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deleteTime_; + } else { + return deleteTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Timestamp when the Organization was requested for deletion.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deleteTime_ = value; + onChanged(); + } else { + deleteTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the Organization was requested for deletion.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (deleteTimeBuilder_ == null) { + deleteTime_ = builderForValue.build(); + onChanged(); + } else { + deleteTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the Organization was requested for deletion.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (deleteTime_ != null) { + deleteTime_ = + com.google.protobuf.Timestamp.newBuilder(deleteTime_).mergeFrom(value).buildPartial(); + } else { + deleteTime_ = value; + } + onChanged(); + } else { + deleteTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the Organization was requested for deletion.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDeleteTime() { + if (deleteTimeBuilder_ == null) { + deleteTime_ = null; + onChanged(); + } else { + deleteTime_ = null; + deleteTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp when the Organization was requested for deletion.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() { + + onChanged(); + return getDeleteTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Timestamp when the Organization was requested for deletion.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + if (deleteTimeBuilder_ != null) { + return deleteTimeBuilder_.getMessageOrBuilder(); + } else { + return deleteTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deleteTime_; + } + } + /** + * + * + *
+     * Output only. Timestamp when the Organization was requested for deletion.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getDeleteTimeFieldBuilder() { + if (deleteTimeBuilder_ == null) { + deleteTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getDeleteTime(), getParentForChildren(), isClean()); + deleteTime_ = null; + } + return deleteTimeBuilder_; + } + + private java.lang.Object 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.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + etag_ = value; + onChanged(); + 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.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + + etag_ = getDefaultInstance().getEtag(); + onChanged(); + 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.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + etag_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.Organization) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.Organization) + private static final com.google.cloud.resourcemanager.v3.Organization DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.Organization(); + } + + public static com.google.cloud.resourcemanager.v3.Organization getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Organization parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Organization(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Organization getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationName.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationName.java new file mode 100644 index 000000000000..9f0b7437f89a --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class OrganizationName implements ResourceName { + private static final PathTemplate ORGANIZATION = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}"); + private volatile Map fieldValuesMap; + private final String organization; + + @Deprecated + protected OrganizationName() { + organization = null; + } + + private OrganizationName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + } + + public String getOrganization() { + return organization; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static OrganizationName of(String organization) { + return newBuilder().setOrganization(organization).build(); + } + + public static String format(String organization) { + return newBuilder().setOrganization(organization).build().toString(); + } + + public static OrganizationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION.validatedMatch( + formattedString, "OrganizationName.parse: formattedString not in valid format"); + return of(matchMap.get("organization")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (OrganizationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION.instantiate("organization", organization); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + OrganizationName that = ((OrganizationName) o); + return Objects.equals(this.organization, that.organization); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + return h; + } + + /** Builder for organizations/{organization}. */ + public static class Builder { + private String organization; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + private Builder(OrganizationName organizationName) { + organization = organizationName.organization; + } + + public OrganizationName build() { + return new OrganizationName(this); + } + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationOrBuilder.java new file mode 100644 index 000000000000..d16be0c2e466 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationOrBuilder.java @@ -0,0 +1,296 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/organizations.proto + +package com.google.cloud.resourcemanager.v3; + +public interface OrganizationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.Organization) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * 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".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * 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.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Immutable. The G Suite / Workspace customer id used in the Directory API.
+   * 
+ * + * string directory_customer_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return Whether the directoryCustomerId field is set. + */ + boolean hasDirectoryCustomerId(); + /** + * + * + *
+   * Immutable. The G Suite / Workspace customer id used in the Directory API.
+   * 
+ * + * string directory_customer_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The directoryCustomerId. + */ + java.lang.String getDirectoryCustomerId(); + /** + * + * + *
+   * Immutable. The G Suite / Workspace customer id used in the Directory API.
+   * 
+ * + * string directory_customer_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for directoryCustomerId. + */ + com.google.protobuf.ByteString getDirectoryCustomerIdBytes(); + + /** + * + * + *
+   * Output only. The organization's current lifecycle state.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Organization.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The organization's current lifecycle state.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Organization.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.resourcemanager.v3.Organization.State getState(); + + /** + * + * + *
+   * Output only. Timestamp when the Organization was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Timestamp when the Organization was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Timestamp when the Organization was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Timestamp when the Organization was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Timestamp when the Organization was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Timestamp when the Organization was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Timestamp when the Organization was requested for deletion.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + boolean hasDeleteTime(); + /** + * + * + *
+   * Output only. Timestamp when the Organization was requested for deletion.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + com.google.protobuf.Timestamp getDeleteTime(); + /** + * + * + *
+   * Output only. Timestamp when the Organization was requested for deletion.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * 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.
+   * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + public com.google.cloud.resourcemanager.v3.Organization.OwnerCase getOwnerCase(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationsProto.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationsProto.java new file mode 100644 index 000000000000..2b48c4dfbb39 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationsProto.java @@ -0,0 +1,213 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/organizations.proto + +package com.google.cloud.resourcemanager.v3; + +public final class OrganizationsProto { + private OrganizationsProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_Organization_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_Organization_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_GetOrganizationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_GetOrganizationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_SearchOrganizationsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_SearchOrganizationsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_SearchOrganizationsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_SearchOrganizationsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_DeleteOrganizationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_DeleteOrganizationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_UndeleteOrganizationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_UndeleteOrganizationMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n3google/cloud/resourcemanager/v3/organi" + + "zations.proto\022\037google.cloud.resourcemana" + + "ger.v3\032\034google/api/annotations.proto\032\027go" + + "ogle/api/client.proto\032\037google/api/field_" + + "behavior.proto\032\031google/api/resource.prot" + + "o\032\036google/iam/v1/iam_policy.proto\032\032googl" + + "e/iam/v1/policy.proto\032#google/longrunnin" + + "g/operations.proto\032\037google/protobuf/time" + + "stamp.proto\"\203\004\n\014Organization\022\021\n\004name\030\001 \001" + + "(\tB\003\340A\003\022\031\n\014display_name\030\002 \001(\tB\003\340A\003\022$\n\025di" + + "rectory_customer_id\030\003 \001(\tB\003\340A\005H\000\022G\n\005stat" + + "e\030\004 \001(\01623.google.cloud.resourcemanager.v" + + "3.Organization.StateB\003\340A\003\0224\n\013create_time" + + "\030\005 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022" + + "4\n\013update_time\030\006 \001(\0132\032.google.protobuf.T" + + "imestampB\003\340A\003\0224\n\013delete_time\030\007 \001(\0132\032.goo" + + "gle.protobuf.TimestampB\003\340A\003\022\021\n\004etag\030\010 \001(" + + "\tB\003\340A\003\"@\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\n" + + "\n\006ACTIVE\020\001\022\024\n\020DELETE_REQUESTED\020\002:V\352AS\n0c" + + "loudresourcemanager.googleapis.com/Organ" + + "ization\022\034organizations/{organization}R\001\001" + + "B\007\n\005owner\"`\n\026GetOrganizationRequest\022F\n\004n" + + "ame\030\001 \001(\tB8\340A\002\372A2\n0cloudresourcemanager." + + "googleapis.com/Organization\"a\n\032SearchOrg" + + "anizationsRequest\022\026\n\tpage_size\030\001 \001(\005B\003\340A" + + "\001\022\027\n\npage_token\030\002 \001(\tB\003\340A\001\022\022\n\005query\030\003 \001(" + + "\tB\003\340A\001\"|\n\033SearchOrganizationsResponse\022D\n" + + "\rorganizations\030\001 \003(\0132-.google.cloud.reso" + + "urcemanager.v3.Organization\022\027\n\017next_page" + + "_token\030\002 \001(\t\"\034\n\032DeleteOrganizationMetada" + + "ta\"\036\n\034UndeleteOrganizationMetadata2\345\007\n\rO" + + "rganizations\022\244\001\n\017GetOrganization\0227.googl" + + "e.cloud.resourcemanager.v3.GetOrganizati" + + "onRequest\032-.google.cloud.resourcemanager" + + ".v3.Organization\")\202\323\344\223\002\034\022\032/v3/{name=orga" + + "nizations/*}\332A\004name\022\272\001\n\023SearchOrganizati" + + "ons\022;.google.cloud.resourcemanager.v3.Se" + + "archOrganizationsRequest\032<.google.cloud." + + "resourcemanager.v3.SearchOrganizationsRe" + + "sponse\"(\202\323\344\223\002\032\022\030/v3/organizations:search" + + "\332A\005query\022\214\001\n\014GetIamPolicy\022\".google.iam.v" + + "1.GetIamPolicyRequest\032\025.google.iam.v1.Po" + + "licy\"A\202\323\344\223\0020\"+/v3/{resource=organization" + + "s/*}:getIamPolicy:\001*\332A\010resource\022\214\001\n\014SetI" + + "amPolicy\022\".google.iam.v1.SetIamPolicyReq" + + "uest\032\025.google.iam.v1.Policy\"A\202\323\344\223\0020\"+/v3" + + "/{resource=organizations/*}:setIamPolicy" + + ":\001*\332A\010resource\022\276\001\n\022TestIamPermissions\022(." + + "google.iam.v1.TestIamPermissionsRequest\032" + + ").google.iam.v1.TestIamPermissionsRespon" + + "se\"S\202\323\344\223\0026\"1/v3/{resource=organizations/" + + "*}:testIamPermissions:\001*\332A\024resource,perm" + + "issions\032\220\001\312A#cloudresourcemanager.google" + + "apis.com\322Aghttps://www.googleapis.com/au" + + "th/cloud-platform,https://www.googleapis" + + ".com/auth/cloud-platform.read-onlyB\317\001\n#c" + + "om.google.cloud.resourcemanager.v3B\022Orga" + + "nizationsProtoP\001ZNgoogle.golang.org/genp" + + "roto/googleapis/cloud/resourcemanager/v3" + + ";resourcemanager\252\002\037Google.Cloud.Resource" + + "Manager.V3\312\002\037Google\\Cloud\\ResourceManage" + + "r\\V3b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.iam.v1.IamPolicyProto.getDescriptor(), + com.google.iam.v1.PolicyProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_resourcemanager_v3_Organization_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_resourcemanager_v3_Organization_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_Organization_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "DirectoryCustomerId", + "State", + "CreateTime", + "UpdateTime", + "DeleteTime", + "Etag", + "Owner", + }); + internal_static_google_cloud_resourcemanager_v3_GetOrganizationRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_resourcemanager_v3_GetOrganizationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_GetOrganizationRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_resourcemanager_v3_SearchOrganizationsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_resourcemanager_v3_SearchOrganizationsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_SearchOrganizationsRequest_descriptor, + new java.lang.String[] { + "PageSize", "PageToken", "Query", + }); + internal_static_google_cloud_resourcemanager_v3_SearchOrganizationsResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_resourcemanager_v3_SearchOrganizationsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_SearchOrganizationsResponse_descriptor, + new java.lang.String[] { + "Organizations", "NextPageToken", + }); + internal_static_google_cloud_resourcemanager_v3_DeleteOrganizationMetadata_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_resourcemanager_v3_DeleteOrganizationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_DeleteOrganizationMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_resourcemanager_v3_UndeleteOrganizationMetadata_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_resourcemanager_v3_UndeleteOrganizationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_UndeleteOrganizationMetadata_descriptor, + new java.lang.String[] {}); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.iam.v1.IamPolicyProto.getDescriptor(); + com.google.iam.v1.PolicyProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/Project.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/Project.java new file mode 100644 index 000000000000..e7cfe9e08147 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/Project.java @@ -0,0 +1,3071 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * A project is a high-level Google Cloud entity. It is a
+ * container for ACLs, APIs, App Engine Apps, VMs, and other
+ * Google Cloud Platform resources.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.Project} + */ +public final class Project extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.Project) + ProjectOrBuilder { + private static final long serialVersionUID = 0L; + // Use Project.newBuilder() to construct. + private Project(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Project() { + name_ = ""; + parent_ = ""; + projectId_ = ""; + state_ = 0; + displayName_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Project(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Project( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + projectId_ = s; + break; + } + case 32: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 50: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 58: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (deleteTime_ != null) { + subBuilder = deleteTime_.toBuilder(); + } + deleteTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deleteTime_); + deleteTime_ = subBuilder.buildPartial(); + } + + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + + etag_ = s; + break; + } + case 82: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_Project_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 10: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_Project_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.Project.class, + com.google.cloud.resourcemanager.v3.Project.Builder.class); + } + + /** + * + * + *
+   * Project lifecycle states.
+   * 
+ * + * Protobuf enum {@code google.cloud.resourcemanager.v3.Project.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified state.  This is only used/useful for distinguishing
+     * unset values.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The normal and active state.
+     * 
+ * + * ACTIVE = 1; + */ + 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].
+     * 
+ * + * DELETE_REQUESTED = 2; + */ + DELETE_REQUESTED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified state.  This is only used/useful for distinguishing
+     * unset values.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The normal and active state.
+     * 
+ * + * ACTIVE = 1; + */ + public static final int ACTIVE_VALUE = 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].
+     * 
+ * + * DELETE_REQUESTED = 2; + */ + public static final int DELETE_REQUESTED_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return ACTIVE; + case 2: + return DELETE_REQUESTED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.Project.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.resourcemanager.v3.Project.State) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. The unique resource name of the project. It is an int64 generated number
+   * prefixed by "projects/".
+   * Example: `projects/415104041262`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The unique resource name of the project. It is an int64 generated number
+   * prefixed by "projects/".
+   * Example: `projects/415104041262`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARENT_FIELD_NUMBER = 2; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Optional. A reference to a parent Resource. eg., `organizations/123` or
+   * `folders/876`.
+   * 
+ * + * string parent = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A reference to a parent Resource. eg., `organizations/123` or
+   * `folders/876`.
+   * 
+ * + * string parent = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object projectId_; + /** + * + * + *
+   * 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`
+   * 
+ * + * string project_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The projectId. + */ + @java.lang.Override + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } + } + /** + * + * + *
+   * 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`
+   * 
+ * + * string project_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for projectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 4; + private int state_; + /** + * + * + *
+   * Output only. The project lifecycle state.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Project.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. The project lifecycle state.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Project.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Project.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.resourcemanager.v3.Project.State result = + com.google.cloud.resourcemanager.v3.Project.State.valueOf(state_); + return result == null ? com.google.cloud.resourcemanager.v3.Project.State.UNRECOGNIZED : result; + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 5; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * 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`
+   * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * 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`
+   * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The most recent time this resource was modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The most recent time this resource was modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The most recent time this resource was modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int DELETE_TIME_FIELD_NUMBER = 8; + private com.google.protobuf.Timestamp deleteTime_; + /** + * + * + *
+   * Output only. The time at which this resource was requested for deletion.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + @java.lang.Override + public boolean hasDeleteTime() { + return deleteTime_ != null; + } + /** + * + * + *
+   * Output only. The time at which this resource was requested for deletion.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getDeleteTime() { + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; + } + /** + * + * + *
+   * Output only. The time at which this resource was requested for deletion.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + return getDeleteTime(); + } + + public static final int ETAG_FIELD_NUMBER = 9; + private volatile java.lang.Object 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.
+   * 
+ * + * string etag = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * 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.
+   * 
+ * + * string etag = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LABELS_FIELD_NUMBER = 10; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_Project_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * 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 256 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"`
+   * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * 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 256 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"`
+   * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * 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 256 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"`
+   * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * 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 256 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"`
+   * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, parent_); + } + if (!getProjectIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, projectId_); + } + if (state_ != com.google.cloud.resourcemanager.v3.Project.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, state_); + } + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, displayName_); + } + if (createTime_ != null) { + output.writeMessage(6, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(7, getUpdateTime()); + } + if (deleteTime_ != null) { + output.writeMessage(8, getDeleteTime()); + } + if (!getEtagBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, etag_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 10); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, parent_); + } + if (!getProjectIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, projectId_); + } + if (state_ != com.google.cloud.resourcemanager.v3.Project.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, state_); + } + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, displayName_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getUpdateTime()); + } + if (deleteTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getDeleteTime()); + } + if (!getEtagBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, etag_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, labels__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.Project)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.Project other = + (com.google.cloud.resourcemanager.v3.Project) obj; + + if (!getName().equals(other.getName())) return false; + if (!getParent().equals(other.getParent())) return false; + if (!getProjectId().equals(other.getProjectId())) return false; + if (state_ != other.state_) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasDeleteTime() != other.hasDeleteTime()) return false; + if (hasDeleteTime()) { + if (!getDeleteTime().equals(other.getDeleteTime())) return false; + } + if (!getEtag().equals(other.getEtag())) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasDeleteTime()) { + hash = (37 * hash) + DELETE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDeleteTime().hashCode(); + } + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.Project parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.Project parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.Project parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.Project parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.Project parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.Project parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.Project parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.Project parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.Project parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.Project parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.Project parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.Project parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.resourcemanager.v3.Project prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A project is a high-level Google Cloud entity. It is a
+   * container for ACLs, APIs, App Engine Apps, VMs, and other
+   * Google Cloud Platform resources.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.Project} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.Project) + com.google.cloud.resourcemanager.v3.ProjectOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_Project_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 10: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 10: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_Project_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.Project.class, + com.google.cloud.resourcemanager.v3.Project.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.Project.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + parent_ = ""; + + projectId_ = ""; + + state_ = 0; + + displayName_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + if (deleteTimeBuilder_ == null) { + deleteTime_ = null; + } else { + deleteTime_ = null; + deleteTimeBuilder_ = null; + } + etag_ = ""; + + internalGetMutableLabels().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_Project_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Project getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.Project.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Project build() { + com.google.cloud.resourcemanager.v3.Project result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Project buildPartial() { + com.google.cloud.resourcemanager.v3.Project result = + new com.google.cloud.resourcemanager.v3.Project(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.parent_ = parent_; + result.projectId_ = projectId_; + result.state_ = state_; + result.displayName_ = displayName_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + if (deleteTimeBuilder_ == null) { + result.deleteTime_ = deleteTime_; + } else { + result.deleteTime_ = deleteTimeBuilder_.build(); + } + result.etag_ = etag_; + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.Project) { + return mergeFrom((com.google.cloud.resourcemanager.v3.Project) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.Project other) { + if (other == com.google.cloud.resourcemanager.v3.Project.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasDeleteTime()) { + mergeDeleteTime(other.getDeleteTime()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + onChanged(); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.Project parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.resourcemanager.v3.Project) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The unique resource name of the project. It is an int64 generated number
+     * prefixed by "projects/".
+     * Example: `projects/415104041262`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The unique resource name of the project. It is an int64 generated number
+     * prefixed by "projects/".
+     * Example: `projects/415104041262`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The unique resource name of the project. It is an int64 generated number
+     * prefixed by "projects/".
+     * Example: `projects/415104041262`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The unique resource name of the project. It is an int64 generated number
+     * prefixed by "projects/".
+     * Example: `projects/415104041262`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The unique resource name of the project. It is an int64 generated number
+     * prefixed by "projects/".
+     * Example: `projects/415104041262`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Optional. A reference to a parent Resource. eg., `organizations/123` or
+     * `folders/876`.
+     * 
+ * + * string parent = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A reference to a parent Resource. eg., `organizations/123` or
+     * `folders/876`.
+     * 
+ * + * string parent = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A reference to a parent Resource. eg., `organizations/123` or
+     * `folders/876`.
+     * 
+ * + * string parent = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A reference to a parent Resource. eg., `organizations/123` or
+     * `folders/876`.
+     * 
+ * + * string parent = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A reference to a parent Resource. eg., `organizations/123` or
+     * `folders/876`.
+     * 
+ * + * string parent = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object projectId_ = ""; + /** + * + * + *
+     * 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`
+     * 
+ * + * string project_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The projectId. + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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`
+     * 
+ * + * string project_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for projectId. + */ + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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`
+     * 
+ * + * string project_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + projectId_ = value; + onChanged(); + 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`
+     * 
+ * + * string project_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + + projectId_ = getDefaultInstance().getProjectId(); + onChanged(); + 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`
+     * 
+ * + * string project_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + projectId_ = value; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The project lifecycle state.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Project.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. The project lifecycle state.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Project.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The project lifecycle state.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Project.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Project.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.resourcemanager.v3.Project.State result = + com.google.cloud.resourcemanager.v3.Project.State.valueOf(state_); + return result == null + ? com.google.cloud.resourcemanager.v3.Project.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The project lifecycle state.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Project.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.resourcemanager.v3.Project.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The project lifecycle state.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Project.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * 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`
+     * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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`
+     * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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`
+     * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + 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`
+     * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + 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`
+     * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The most recent time this resource was modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The most recent time this resource was modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The most recent time this resource was modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The most recent time this resource was modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The most recent time this resource was modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The most recent time this resource was modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The most recent time this resource was modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The most recent time this resource was modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The most recent time this resource was modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.Timestamp deleteTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + deleteTimeBuilder_; + /** + * + * + *
+     * Output only. The time at which this resource was requested for deletion.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + public boolean hasDeleteTime() { + return deleteTimeBuilder_ != null || deleteTime_ != null; + } + /** + * + * + *
+     * Output only. The time at which this resource was requested for deletion.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + public com.google.protobuf.Timestamp getDeleteTime() { + if (deleteTimeBuilder_ == null) { + return deleteTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deleteTime_; + } else { + return deleteTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time at which this resource was requested for deletion.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deleteTime_ = value; + onChanged(); + } else { + deleteTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time at which this resource was requested for deletion.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (deleteTimeBuilder_ == null) { + deleteTime_ = builderForValue.build(); + onChanged(); + } else { + deleteTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time at which this resource was requested for deletion.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (deleteTime_ != null) { + deleteTime_ = + com.google.protobuf.Timestamp.newBuilder(deleteTime_).mergeFrom(value).buildPartial(); + } else { + deleteTime_ = value; + } + onChanged(); + } else { + deleteTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time at which this resource was requested for deletion.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDeleteTime() { + if (deleteTimeBuilder_ == null) { + deleteTime_ = null; + onChanged(); + } else { + deleteTime_ = null; + deleteTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time at which this resource was requested for deletion.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() { + + onChanged(); + return getDeleteTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which this resource was requested for deletion.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + if (deleteTimeBuilder_ != null) { + return deleteTimeBuilder_.getMessageOrBuilder(); + } else { + return deleteTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deleteTime_; + } + } + /** + * + * + *
+     * Output only. The time at which this resource was requested for deletion.
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getDeleteTimeFieldBuilder() { + if (deleteTimeBuilder_ == null) { + deleteTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getDeleteTime(), getParentForChildren(), isClean()); + deleteTime_ = null; + } + return deleteTimeBuilder_; + } + + private java.lang.Object 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.
+     * 
+ * + * string etag = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string etag = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string etag = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + etag_ = value; + onChanged(); + 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.
+     * 
+ * + * string etag = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + + etag_ = getDefaultInstance().getEtag(); + onChanged(); + 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.
+     * 
+ * + * string etag = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + etag_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * 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 256 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"`
+     * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * 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 256 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"`
+     * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * 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 256 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"`
+     * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * 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 256 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"`
+     * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + 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 256 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"`
+     * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * 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 256 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"`
+     * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + 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 256 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"`
+     * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.Project) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.Project) + private static final com.google.cloud.resourcemanager.v3.Project DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.Project(); + } + + public static com.google.cloud.resourcemanager.v3.Project getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Project parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Project(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Project getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ProjectName.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ProjectName.java new file mode 100644 index 000000000000..b1e8a5ccc5bf --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ProjectName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class ProjectName implements ResourceName { + private static final PathTemplate PROJECT = + PathTemplate.createWithoutUrlEncoding("projects/{project}"); + private volatile Map fieldValuesMap; + private final String project; + + @Deprecated + protected ProjectName() { + project = null; + } + + private ProjectName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + } + + public String getProject() { + return project; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ProjectName of(String project) { + return newBuilder().setProject(project).build(); + } + + public static String format(String project) { + return newBuilder().setProject(project).build().toString(); + } + + public static ProjectName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT.validatedMatch( + formattedString, "ProjectName.parse: formattedString not in valid format"); + return of(matchMap.get("project")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (ProjectName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT.instantiate("project", project); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ProjectName that = ((ProjectName) o); + return Objects.equals(this.project, that.project); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + return h; + } + + /** Builder for projects/{project}. */ + public static class Builder { + private String project; + + protected Builder() {} + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder(ProjectName projectName) { + project = projectName.project; + } + + public ProjectName build() { + return new ProjectName(this); + } + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ProjectOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ProjectOrBuilder.java new file mode 100644 index 000000000000..3935af40abff --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ProjectOrBuilder.java @@ -0,0 +1,413 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +public interface ProjectOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.Project) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The unique resource name of the project. It is an int64 generated number
+   * prefixed by "projects/".
+   * Example: `projects/415104041262`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The unique resource name of the project. It is an int64 generated number
+   * prefixed by "projects/".
+   * Example: `projects/415104041262`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. A reference to a parent Resource. eg., `organizations/123` or
+   * `folders/876`.
+   * 
+ * + * string parent = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Optional. A reference to a parent Resource. eg., `organizations/123` or
+   * `folders/876`.
+   * 
+ * + * string parent = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * 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`
+   * 
+ * + * string project_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + /** + * + * + *
+   * 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`
+   * 
+ * + * string project_id = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); + + /** + * + * + *
+   * Output only. The project lifecycle state.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Project.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The project lifecycle state.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Project.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.resourcemanager.v3.Project.State getState(); + + /** + * + * + *
+   * 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`
+   * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * 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`
+   * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. Creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The most recent time this resource was modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The most recent time this resource was modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The most recent time this resource was modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time at which this resource was requested for deletion.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + boolean hasDeleteTime(); + /** + * + * + *
+   * Output only. The time at which this resource was requested for deletion.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + com.google.protobuf.Timestamp getDeleteTime(); + /** + * + * + *
+   * Output only. The time at which this resource was requested for deletion.
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * string etag = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * 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.
+   * 
+ * + * string etag = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * 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 256 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"`
+   * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + int getLabelsCount(); + /** + * + * + *
+   * 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 256 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"`
+   * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * 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 256 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"`
+   * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * 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 256 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"`
+   * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * 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 256 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"`
+   * 
+ * + * map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ProjectsProto.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ProjectsProto.java new file mode 100644 index 000000000000..6b25b7ce597b --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/ProjectsProto.java @@ -0,0 +1,397 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +public final class ProjectsProto { + private ProjectsProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_Project_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_Project_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_Project_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_Project_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_GetProjectRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_GetProjectRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_ListProjectsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_ListProjectsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_ListProjectsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_ListProjectsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_SearchProjectsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_SearchProjectsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_SearchProjectsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_SearchProjectsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_CreateProjectRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_CreateProjectRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_CreateProjectMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_CreateProjectMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_UpdateProjectRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_UpdateProjectRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_UpdateProjectMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_UpdateProjectMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_MoveProjectRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_MoveProjectRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_MoveProjectMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_MoveProjectMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_DeleteProjectRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_DeleteProjectRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_DeleteProjectMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_DeleteProjectMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_UndeleteProjectRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_UndeleteProjectRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_UndeleteProjectMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_UndeleteProjectMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n.google/cloud/resourcemanager/v3/projec" + + "ts.proto\022\037google.cloud.resourcemanager.v" + + "3\032\034google/api/annotations.proto\032\027google/" + + "api/client.proto\032\037google/api/field_behav" + + "ior.proto\032\031google/api/resource.proto\032\036go" + + "ogle/iam/v1/iam_policy.proto\032\032google/iam" + + "/v1/policy.proto\032#google/longrunning/ope" + + "rations.proto\032 google/protobuf/field_mas" + + "k.proto\032\037google/protobuf/timestamp.proto" + + "\"\343\004\n\007Project\022\021\n\004name\030\001 \001(\tB\003\340A\003\022\023\n\006paren" + + "t\030\002 \001(\tB\003\340A\001\022\027\n\nproject_id\030\003 \001(\tB\003\340A\005\022B\n" + + "\005state\030\004 \001(\0162..google.cloud.resourcemana" + + "ger.v3.Project.StateB\003\340A\003\022\031\n\014display_nam" + + "e\030\005 \001(\tB\003\340A\001\0224\n\013create_time\030\006 \001(\0132\032.goog" + + "le.protobuf.TimestampB\003\340A\003\0224\n\013update_tim" + + "e\030\007 \001(\0132\032.google.protobuf.TimestampB\003\340A\003" + + "\0224\n\013delete_time\030\010 \001(\0132\032.google.protobuf." + + "TimestampB\003\340A\003\022\021\n\004etag\030\t \001(\tB\003\340A\003\022I\n\006lab" + + "els\030\n \003(\01324.google.cloud.resourcemanager" + + ".v3.Project.LabelsEntryB\003\340A\001\032-\n\013LabelsEn" + + "try\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"@\n\005S" + + "tate\022\025\n\021STATE_UNSPECIFIED\020\000\022\n\n\006ACTIVE\020\001\022" + + "\024\n\020DELETE_REQUESTED\020\002:G\352AD\n+cloudresourc" + + "emanager.googleapis.com/Project\022\022project" + + "s/{project}R\001\001\"V\n\021GetProjectRequest\022A\n\004n" + + "ame\030\001 \001(\tB3\340A\002\372A-\n+cloudresourcemanager." + + "googleapis.com/Project\"|\n\023ListProjectsRe" + + "quest\022\031\n\006parent\030\001 \001(\tB\t\340A\002\372A\003\022\001*\022\027\n\npage" + + "_token\030\002 \001(\tB\003\340A\001\022\026\n\tpage_size\030\003 \001(\005B\003\340A" + + "\001\022\031\n\014show_deleted\030\004 \001(\010B\003\340A\001\"k\n\024ListProj" + + "ectsResponse\022:\n\010projects\030\001 \003(\0132(.google." + + "cloud.resourcemanager.v3.Project\022\027\n\017next" + + "_page_token\030\002 \001(\t\"\\\n\025SearchProjectsReque" + + "st\022\022\n\005query\030\001 \001(\tB\003\340A\001\022\027\n\npage_token\030\002 \001" + + "(\tB\003\340A\001\022\026\n\tpage_size\030\003 \001(\005B\003\340A\001\"m\n\026Searc" + + "hProjectsResponse\022:\n\010projects\030\001 \003(\0132(.go" + + "ogle.cloud.resourcemanager.v3.Project\022\027\n" + + "\017next_page_token\030\002 \001(\t\"V\n\024CreateProjectR" + + "equest\022>\n\007project\030\001 \001(\0132(.google.cloud.r" + + "esourcemanager.v3.ProjectB\003\340A\002\"i\n\025Create" + + "ProjectMetadata\022/\n\013create_time\030\001 \001(\0132\032.g" + + "oogle.protobuf.Timestamp\022\020\n\010gettable\030\002 \001" + + "(\010\022\r\n\005ready\030\003 \001(\010\"\214\001\n\024UpdateProjectReque" + + "st\022>\n\007project\030\001 \001(\0132(.google.cloud.resou" + + "rcemanager.v3.ProjectB\003\340A\002\0224\n\013update_mas" + + "k\030\002 \001(\0132\032.google.protobuf.FieldMaskB\003\340A\001" + + "\"\027\n\025UpdateProjectMetadata\"~\n\022MoveProject" + + "Request\022A\n\004name\030\001 \001(\tB3\340A\002\372A-\n+cloudreso" + + "urcemanager.googleapis.com/Project\022%\n\022de" + + "stination_parent\030\002 \001(\tB\t\340A\002\372A\003\022\001*\"\025\n\023Mov" + + "eProjectMetadata\"Y\n\024DeleteProjectRequest" + + "\022A\n\004name\030\001 \001(\tB3\340A\002\372A-\n+cloudresourceman" + + "ager.googleapis.com/Project\"\027\n\025DeletePro" + + "jectMetadata\"[\n\026UndeleteProjectRequest\022A" + + "\n\004name\030\001 \001(\tB3\340A\002\372A-\n+cloudresourcemanag" + + "er.googleapis.com/Project\"\031\n\027UndeletePro" + + "jectMetadata2\217\020\n\010Projects\022\220\001\n\nGetProject" + + "\0222.google.cloud.resourcemanager.v3.GetPr" + + "ojectRequest\032(.google.cloud.resourcemana" + + "ger.v3.Project\"$\202\323\344\223\002\027\022\025/v3/{name=projec" + + "ts/*}\332A\004name\022\232\001\n\014ListProjects\0224.google.c" + + "loud.resourcemanager.v3.ListProjectsRequ" + + "est\0325.google.cloud.resourcemanager.v3.Li" + + "stProjectsResponse\"\035\202\323\344\223\002\016\022\014/v3/projects" + + "\332A\006parent\022\246\001\n\016SearchProjects\0226.google.cl" + + "oud.resourcemanager.v3.SearchProjectsReq" + + "uest\0327.google.cloud.resourcemanager.v3.S" + + "earchProjectsResponse\"#\202\323\344\223\002\025\022\023/v3/proje" + + "cts:search\332A\005query\022\261\001\n\rCreateProject\0225.g" + + "oogle.cloud.resourcemanager.v3.CreatePro" + + "jectRequest\032\035.google.longrunning.Operati" + + "on\"J\202\323\344\223\002\027\"\014/v3/projects:\007project\332A\007proj" + + "ect\312A \n\007Project\022\025CreateProjectMetadata\022\316" + + "\001\n\rUpdateProject\0225.google.cloud.resource" + + "manager.v3.UpdateProjectRequest\032\035.google" + + ".longrunning.Operation\"g\202\323\344\223\002(2\035/v3/{pro" + + "ject.name=projects/*}:\007project\332A\023project" + + ",update_mask\312A \n\007Project\022\025UpdateProjectM" + + "etadata\022\304\001\n\013MoveProject\0223.google.cloud.r" + + "esourcemanager.v3.MoveProjectRequest\032\035.g" + + "oogle.longrunning.Operation\"a\202\323\344\223\002\037\"\032/v3" + + "/{name=projects/*}:move:\001*\332A\030name, desti" + + "nation_parent\312A\036\n\007Project\022\023MoveProjectMe" + + "tadata\022\256\001\n\rDeleteProject\0225.google.cloud." + + "resourcemanager.v3.DeleteProjectRequest\032" + + "\035.google.longrunning.Operation\"G\202\323\344\223\002\027*\025" + + "/v3/{name=projects/*}\332A\004name\312A \n\007Project" + + "\022\025DeleteProjectMetadata\022\300\001\n\017UndeleteProj" + + "ect\0227.google.cloud.resourcemanager.v3.Un" + + "deleteProjectRequest\032\035.google.longrunnin" + + "g.Operation\"U\202\323\344\223\002#\"\036/v3/{name=projects/" + + "*}:undelete:\001*\332A\004name\312A\"\n\007Project\022\027Undel" + + "eteProjectMetadata\022\207\001\n\014GetIamPolicy\022\".go" + + "ogle.iam.v1.GetIamPolicyRequest\032\025.google" + + ".iam.v1.Policy\"<\202\323\344\223\002+\"&/v3/{resource=pr" + + "ojects/*}:getIamPolicy:\001*\332A\010resource\022\217\001\n" + + "\014SetIamPolicy\022\".google.iam.v1.SetIamPoli" + + "cyRequest\032\025.google.iam.v1.Policy\"D\202\323\344\223\002+" + + "\"&/v3/{resource=projects/*}:setIamPolicy" + + ":\001*\332A\020resource, policy\022\272\001\n\022TestIamPermis" + + "sions\022(.google.iam.v1.TestIamPermissions" + + "Request\032).google.iam.v1.TestIamPermissio" + + "nsResponse\"O\202\323\344\223\0021\",/v3/{resource=projec" + + "ts/*}:testIamPermissions:\001*\332A\025resource, " + + "permissions\032\220\001\312A#cloudresourcemanager.go" + + "ogleapis.com\322Aghttps://www.googleapis.co" + + "m/auth/cloud-platform,https://www.google" + + "apis.com/auth/cloud-platform.read-onlyB\312" + + "\001\n#com.google.cloud.resourcemanager.v3B\r" + + "ProjectsProtoP\001ZNgoogle.golang.org/genpr" + + "oto/googleapis/cloud/resourcemanager/v3;" + + "resourcemanager\252\002\037Google.Cloud.ResourceM" + + "anager.V3\312\002\037Google\\Cloud\\ResourceManager" + + "\\V3b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.iam.v1.IamPolicyProto.getDescriptor(), + com.google.iam.v1.PolicyProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_resourcemanager_v3_Project_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_resourcemanager_v3_Project_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_Project_descriptor, + new java.lang.String[] { + "Name", + "Parent", + "ProjectId", + "State", + "DisplayName", + "CreateTime", + "UpdateTime", + "DeleteTime", + "Etag", + "Labels", + }); + internal_static_google_cloud_resourcemanager_v3_Project_LabelsEntry_descriptor = + internal_static_google_cloud_resourcemanager_v3_Project_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_resourcemanager_v3_Project_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_Project_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_resourcemanager_v3_GetProjectRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_resourcemanager_v3_GetProjectRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_GetProjectRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_resourcemanager_v3_ListProjectsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_resourcemanager_v3_ListProjectsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_ListProjectsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageToken", "PageSize", "ShowDeleted", + }); + internal_static_google_cloud_resourcemanager_v3_ListProjectsResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_resourcemanager_v3_ListProjectsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_ListProjectsResponse_descriptor, + new java.lang.String[] { + "Projects", "NextPageToken", + }); + internal_static_google_cloud_resourcemanager_v3_SearchProjectsRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_resourcemanager_v3_SearchProjectsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_SearchProjectsRequest_descriptor, + new java.lang.String[] { + "Query", "PageToken", "PageSize", + }); + internal_static_google_cloud_resourcemanager_v3_SearchProjectsResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_resourcemanager_v3_SearchProjectsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_SearchProjectsResponse_descriptor, + new java.lang.String[] { + "Projects", "NextPageToken", + }); + internal_static_google_cloud_resourcemanager_v3_CreateProjectRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_resourcemanager_v3_CreateProjectRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_CreateProjectRequest_descriptor, + new java.lang.String[] { + "Project", + }); + internal_static_google_cloud_resourcemanager_v3_CreateProjectMetadata_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_resourcemanager_v3_CreateProjectMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_CreateProjectMetadata_descriptor, + new java.lang.String[] { + "CreateTime", "Gettable", "Ready", + }); + internal_static_google_cloud_resourcemanager_v3_UpdateProjectRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_resourcemanager_v3_UpdateProjectRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_UpdateProjectRequest_descriptor, + new java.lang.String[] { + "Project", "UpdateMask", + }); + internal_static_google_cloud_resourcemanager_v3_UpdateProjectMetadata_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_resourcemanager_v3_UpdateProjectMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_UpdateProjectMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_resourcemanager_v3_MoveProjectRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_resourcemanager_v3_MoveProjectRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_MoveProjectRequest_descriptor, + new java.lang.String[] { + "Name", "DestinationParent", + }); + internal_static_google_cloud_resourcemanager_v3_MoveProjectMetadata_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_resourcemanager_v3_MoveProjectMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_MoveProjectMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_resourcemanager_v3_DeleteProjectRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_resourcemanager_v3_DeleteProjectRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_DeleteProjectRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_resourcemanager_v3_DeleteProjectMetadata_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_resourcemanager_v3_DeleteProjectMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_DeleteProjectMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_resourcemanager_v3_UndeleteProjectRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_resourcemanager_v3_UndeleteProjectRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_UndeleteProjectRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_resourcemanager_v3_UndeleteProjectMetadata_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_resourcemanager_v3_UndeleteProjectMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_UndeleteProjectMetadata_descriptor, + new java.lang.String[] {}); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.iam.v1.IamPolicyProto.getDescriptor(); + com.google.iam.v1.PolicyProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchFoldersRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchFoldersRequest.java new file mode 100644 index 000000000000..7c05a4888ba4 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchFoldersRequest.java @@ -0,0 +1,1078 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The request message for searching folders.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.SearchFoldersRequest} + */ +public final class SearchFoldersRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.SearchFoldersRequest) + SearchFoldersRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchFoldersRequest.newBuilder() to construct. + private SearchFoldersRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchFoldersRequest() { + pageToken_ = ""; + query_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchFoldersRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchFoldersRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + pageSize_ = input.readInt32(); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + query_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_SearchFoldersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_SearchFoldersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.SearchFoldersRequest.class, + com.google.cloud.resourcemanager.v3.SearchFoldersRequest.Builder.class); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 1; + private int pageSize_; + /** + * + * + *
+   * Optional. The maximum number of folders to return in the response.
+   * If unspecified, server picks an appropriate default.
+   * 
+ * + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to `SearchFolders`
+   * that indicates from where search should continue.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to `SearchFolders`
+   * that indicates from where search should continue.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_FIELD_NUMBER = 3; + private volatile java.lang.Object 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".
+   * 
+ * + * string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The query. + */ + @java.lang.Override + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } + } + /** + * + * + *
+   * 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".
+   * 
+ * + * string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for query. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (pageSize_ != 0) { + output.writeInt32(1, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + if (!getQueryBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, query_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + if (!getQueryBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, query_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.SearchFoldersRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.SearchFoldersRequest other = + (com.google.cloud.resourcemanager.v3.SearchFoldersRequest) obj; + + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getQuery().equals(other.getQuery())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.SearchFoldersRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for searching folders.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.SearchFoldersRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.SearchFoldersRequest) + com.google.cloud.resourcemanager.v3.SearchFoldersRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_SearchFoldersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_SearchFoldersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.SearchFoldersRequest.class, + com.google.cloud.resourcemanager.v3.SearchFoldersRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.SearchFoldersRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + pageSize_ = 0; + + pageToken_ = ""; + + query_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_SearchFoldersRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.SearchFoldersRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.SearchFoldersRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.SearchFoldersRequest build() { + com.google.cloud.resourcemanager.v3.SearchFoldersRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.SearchFoldersRequest buildPartial() { + com.google.cloud.resourcemanager.v3.SearchFoldersRequest result = + new com.google.cloud.resourcemanager.v3.SearchFoldersRequest(this); + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.query_ = query_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.SearchFoldersRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.SearchFoldersRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.SearchFoldersRequest other) { + if (other == com.google.cloud.resourcemanager.v3.SearchFoldersRequest.getDefaultInstance()) + return this; + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.SearchFoldersRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.SearchFoldersRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of folders to return in the response.
+     * If unspecified, server picks an appropriate default.
+     * 
+ * + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of folders to return in the response.
+     * If unspecified, server picks an appropriate default.
+     * 
+ * + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of folders to return in the response.
+     * If unspecified, server picks an appropriate default.
+     * 
+ * + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `SearchFolders`
+     * that indicates from where search should continue.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `SearchFolders`
+     * that indicates from where search should continue.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `SearchFolders`
+     * that indicates from where search should continue.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `SearchFolders`
+     * that indicates from where search should continue.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `SearchFolders`
+     * that indicates from where search should continue.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object 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".
+     * 
+ * + * string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The query. + */ + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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".
+     * 
+ * + * string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for query. + */ + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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".
+     * 
+ * + * string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + query_ = value; + onChanged(); + 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".
+     * 
+ * + * string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + + query_ = getDefaultInstance().getQuery(); + onChanged(); + 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".
+     * 
+ * + * string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + public Builder setQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + query_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.SearchFoldersRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.SearchFoldersRequest) + private static final com.google.cloud.resourcemanager.v3.SearchFoldersRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.SearchFoldersRequest(); + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchFoldersRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchFoldersRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.SearchFoldersRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchFoldersRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchFoldersRequestOrBuilder.java new file mode 100644 index 000000000000..e02168caaff5 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchFoldersRequestOrBuilder.java @@ -0,0 +1,137 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +public interface SearchFoldersRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.SearchFoldersRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The maximum number of folders to return in the response.
+   * If unspecified, server picks an appropriate default.
+   * 
+ * + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to `SearchFolders`
+   * that indicates from where search should continue.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to `SearchFolders`
+   * that indicates from where search should continue.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * 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".
+   * 
+ * + * string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The query. + */ + java.lang.String getQuery(); + /** + * + * + *
+   * 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".
+   * 
+ * + * string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchFoldersResponse.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchFoldersResponse.java new file mode 100644 index 000000000000..9b7c2ef2cfb1 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchFoldersResponse.java @@ -0,0 +1,1159 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The response message for searching folders.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.SearchFoldersResponse} + */ +public final class SearchFoldersResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.SearchFoldersResponse) + SearchFoldersResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchFoldersResponse.newBuilder() to construct. + private SearchFoldersResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchFoldersResponse() { + folders_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchFoldersResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchFoldersResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + folders_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + folders_.add( + input.readMessage( + com.google.cloud.resourcemanager.v3.Folder.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + folders_ = java.util.Collections.unmodifiableList(folders_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_SearchFoldersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_SearchFoldersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.SearchFoldersResponse.class, + com.google.cloud.resourcemanager.v3.SearchFoldersResponse.Builder.class); + } + + public static final int FOLDERS_FIELD_NUMBER = 1; + private java.util.List folders_; + /** + * + * + *
+   * A possibly paginated folder search results.
+   * the specified parent resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + @java.lang.Override + public java.util.List getFoldersList() { + return folders_; + } + /** + * + * + *
+   * A possibly paginated folder search results.
+   * the specified parent resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + @java.lang.Override + public java.util.List + getFoldersOrBuilderList() { + return folders_; + } + /** + * + * + *
+   * A possibly paginated folder search results.
+   * the specified parent resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + @java.lang.Override + public int getFoldersCount() { + return folders_.size(); + } + /** + * + * + *
+   * A possibly paginated folder search results.
+   * the specified parent resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Folder getFolders(int index) { + return folders_.get(index); + } + /** + * + * + *
+   * A possibly paginated folder search results.
+   * the specified parent resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.FolderOrBuilder getFoldersOrBuilder(int index) { + return folders_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A pagination token returned from a previous call to `SearchFolders`
+   * that indicates from where searching should continue.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A pagination token returned from a previous call to `SearchFolders`
+   * that indicates from where searching should continue.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < folders_.size(); i++) { + output.writeMessage(1, folders_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < folders_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, folders_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.SearchFoldersResponse)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.SearchFoldersResponse other = + (com.google.cloud.resourcemanager.v3.SearchFoldersResponse) obj; + + if (!getFoldersList().equals(other.getFoldersList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFoldersCount() > 0) { + hash = (37 * hash) + FOLDERS_FIELD_NUMBER; + hash = (53 * hash) + getFoldersList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.SearchFoldersResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The response message for searching folders.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.SearchFoldersResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.SearchFoldersResponse) + com.google.cloud.resourcemanager.v3.SearchFoldersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_SearchFoldersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_SearchFoldersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.SearchFoldersResponse.class, + com.google.cloud.resourcemanager.v3.SearchFoldersResponse.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.SearchFoldersResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFoldersFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (foldersBuilder_ == null) { + folders_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + foldersBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_SearchFoldersResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.SearchFoldersResponse getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.SearchFoldersResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.SearchFoldersResponse build() { + com.google.cloud.resourcemanager.v3.SearchFoldersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.SearchFoldersResponse buildPartial() { + com.google.cloud.resourcemanager.v3.SearchFoldersResponse result = + new com.google.cloud.resourcemanager.v3.SearchFoldersResponse(this); + int from_bitField0_ = bitField0_; + if (foldersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + folders_ = java.util.Collections.unmodifiableList(folders_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.folders_ = folders_; + } else { + result.folders_ = foldersBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.SearchFoldersResponse) { + return mergeFrom((com.google.cloud.resourcemanager.v3.SearchFoldersResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.SearchFoldersResponse other) { + if (other == com.google.cloud.resourcemanager.v3.SearchFoldersResponse.getDefaultInstance()) + return this; + if (foldersBuilder_ == null) { + if (!other.folders_.isEmpty()) { + if (folders_.isEmpty()) { + folders_ = other.folders_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFoldersIsMutable(); + folders_.addAll(other.folders_); + } + onChanged(); + } + } else { + if (!other.folders_.isEmpty()) { + if (foldersBuilder_.isEmpty()) { + foldersBuilder_.dispose(); + foldersBuilder_ = null; + folders_ = other.folders_; + bitField0_ = (bitField0_ & ~0x00000001); + foldersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFoldersFieldBuilder() + : null; + } else { + foldersBuilder_.addAllMessages(other.folders_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.SearchFoldersResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.SearchFoldersResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List folders_ = + java.util.Collections.emptyList(); + + private void ensureFoldersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + folders_ = new java.util.ArrayList(folders_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Folder, + com.google.cloud.resourcemanager.v3.Folder.Builder, + com.google.cloud.resourcemanager.v3.FolderOrBuilder> + foldersBuilder_; + + /** + * + * + *
+     * A possibly paginated folder search results.
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public java.util.List getFoldersList() { + if (foldersBuilder_ == null) { + return java.util.Collections.unmodifiableList(folders_); + } else { + return foldersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A possibly paginated folder search results.
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public int getFoldersCount() { + if (foldersBuilder_ == null) { + return folders_.size(); + } else { + return foldersBuilder_.getCount(); + } + } + /** + * + * + *
+     * A possibly paginated folder search results.
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public com.google.cloud.resourcemanager.v3.Folder getFolders(int index) { + if (foldersBuilder_ == null) { + return folders_.get(index); + } else { + return foldersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A possibly paginated folder search results.
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public Builder setFolders(int index, com.google.cloud.resourcemanager.v3.Folder value) { + if (foldersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFoldersIsMutable(); + folders_.set(index, value); + onChanged(); + } else { + foldersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A possibly paginated folder search results.
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public Builder setFolders( + int index, com.google.cloud.resourcemanager.v3.Folder.Builder builderForValue) { + if (foldersBuilder_ == null) { + ensureFoldersIsMutable(); + folders_.set(index, builderForValue.build()); + onChanged(); + } else { + foldersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A possibly paginated folder search results.
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public Builder addFolders(com.google.cloud.resourcemanager.v3.Folder value) { + if (foldersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFoldersIsMutable(); + folders_.add(value); + onChanged(); + } else { + foldersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A possibly paginated folder search results.
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public Builder addFolders(int index, com.google.cloud.resourcemanager.v3.Folder value) { + if (foldersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFoldersIsMutable(); + folders_.add(index, value); + onChanged(); + } else { + foldersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A possibly paginated folder search results.
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public Builder addFolders(com.google.cloud.resourcemanager.v3.Folder.Builder builderForValue) { + if (foldersBuilder_ == null) { + ensureFoldersIsMutable(); + folders_.add(builderForValue.build()); + onChanged(); + } else { + foldersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A possibly paginated folder search results.
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public Builder addFolders( + int index, com.google.cloud.resourcemanager.v3.Folder.Builder builderForValue) { + if (foldersBuilder_ == null) { + ensureFoldersIsMutable(); + folders_.add(index, builderForValue.build()); + onChanged(); + } else { + foldersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A possibly paginated folder search results.
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public Builder addAllFolders( + java.lang.Iterable values) { + if (foldersBuilder_ == null) { + ensureFoldersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, folders_); + onChanged(); + } else { + foldersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A possibly paginated folder search results.
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public Builder clearFolders() { + if (foldersBuilder_ == null) { + folders_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + foldersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A possibly paginated folder search results.
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public Builder removeFolders(int index) { + if (foldersBuilder_ == null) { + ensureFoldersIsMutable(); + folders_.remove(index); + onChanged(); + } else { + foldersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A possibly paginated folder search results.
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public com.google.cloud.resourcemanager.v3.Folder.Builder getFoldersBuilder(int index) { + return getFoldersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A possibly paginated folder search results.
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public com.google.cloud.resourcemanager.v3.FolderOrBuilder getFoldersOrBuilder(int index) { + if (foldersBuilder_ == null) { + return folders_.get(index); + } else { + return foldersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A possibly paginated folder search results.
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public java.util.List + getFoldersOrBuilderList() { + if (foldersBuilder_ != null) { + return foldersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(folders_); + } + } + /** + * + * + *
+     * A possibly paginated folder search results.
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public com.google.cloud.resourcemanager.v3.Folder.Builder addFoldersBuilder() { + return getFoldersFieldBuilder() + .addBuilder(com.google.cloud.resourcemanager.v3.Folder.getDefaultInstance()); + } + /** + * + * + *
+     * A possibly paginated folder search results.
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public com.google.cloud.resourcemanager.v3.Folder.Builder addFoldersBuilder(int index) { + return getFoldersFieldBuilder() + .addBuilder(index, com.google.cloud.resourcemanager.v3.Folder.getDefaultInstance()); + } + /** + * + * + *
+     * A possibly paginated folder search results.
+     * the specified parent resource.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + public java.util.List + getFoldersBuilderList() { + return getFoldersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Folder, + com.google.cloud.resourcemanager.v3.Folder.Builder, + com.google.cloud.resourcemanager.v3.FolderOrBuilder> + getFoldersFieldBuilder() { + if (foldersBuilder_ == null) { + foldersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Folder, + com.google.cloud.resourcemanager.v3.Folder.Builder, + com.google.cloud.resourcemanager.v3.FolderOrBuilder>( + folders_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + folders_ = null; + } + return foldersBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A pagination token returned from a previous call to `SearchFolders`
+     * that indicates from where searching should continue.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A pagination token returned from a previous call to `SearchFolders`
+     * that indicates from where searching should continue.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A pagination token returned from a previous call to `SearchFolders`
+     * that indicates from where searching should continue.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A pagination token returned from a previous call to `SearchFolders`
+     * that indicates from where searching should continue.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A pagination token returned from a previous call to `SearchFolders`
+     * that indicates from where searching should continue.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.SearchFoldersResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.SearchFoldersResponse) + private static final com.google.cloud.resourcemanager.v3.SearchFoldersResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.SearchFoldersResponse(); + } + + public static com.google.cloud.resourcemanager.v3.SearchFoldersResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchFoldersResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchFoldersResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.SearchFoldersResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchFoldersResponseOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchFoldersResponseOrBuilder.java new file mode 100644 index 000000000000..e0a128ac0280 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchFoldersResponseOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +public interface SearchFoldersResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.SearchFoldersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A possibly paginated folder search results.
+   * the specified parent resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + java.util.List getFoldersList(); + /** + * + * + *
+   * A possibly paginated folder search results.
+   * the specified parent resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + com.google.cloud.resourcemanager.v3.Folder getFolders(int index); + /** + * + * + *
+   * A possibly paginated folder search results.
+   * the specified parent resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + int getFoldersCount(); + /** + * + * + *
+   * A possibly paginated folder search results.
+   * the specified parent resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + java.util.List + getFoldersOrBuilderList(); + /** + * + * + *
+   * A possibly paginated folder search results.
+   * the specified parent resource.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Folder folders = 1; + */ + com.google.cloud.resourcemanager.v3.FolderOrBuilder getFoldersOrBuilder(int index); + + /** + * + * + *
+   * A pagination token returned from a previous call to `SearchFolders`
+   * that indicates from where searching should continue.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A pagination token returned from a previous call to `SearchFolders`
+   * that indicates from where searching should continue.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchOrganizationsRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchOrganizationsRequest.java new file mode 100644 index 000000000000..9f0d565ed5bc --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchOrganizationsRequest.java @@ -0,0 +1,1007 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/organizations.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The request sent to the `SearchOrganizations` method.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.SearchOrganizationsRequest} + */ +public final class SearchOrganizationsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.SearchOrganizationsRequest) + SearchOrganizationsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchOrganizationsRequest.newBuilder() to construct. + private SearchOrganizationsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchOrganizationsRequest() { + pageToken_ = ""; + query_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchOrganizationsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchOrganizationsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + pageSize_ = input.readInt32(); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + query_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_SearchOrganizationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_SearchOrganizationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest.class, + com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest.Builder.class); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 1; + private int pageSize_; + /** + * + * + *
+   * Optional. The maximum number of organizations to return in the response.
+   * If unspecified, server picks an appropriate default.
+   * 
+ * + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to `SearchOrganizations`
+   * that indicates from where listing should continue.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to `SearchOrganizations`
+   * that indicates from where listing should continue.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_FIELD_NUMBER = 3; + private volatile java.lang.Object 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`.
+   * 
+ * + * string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The query. + */ + @java.lang.Override + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } + } + /** + * + * + *
+   * 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`.
+   * 
+ * + * string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for query. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (pageSize_ != 0) { + output.writeInt32(1, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + if (!getQueryBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, query_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + if (!getQueryBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, query_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest other = + (com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest) obj; + + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getQuery().equals(other.getQuery())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request sent to the `SearchOrganizations` method.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.SearchOrganizationsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.SearchOrganizationsRequest) + com.google.cloud.resourcemanager.v3.SearchOrganizationsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_SearchOrganizationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_SearchOrganizationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest.class, + com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + pageSize_ = 0; + + pageToken_ = ""; + + query_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_SearchOrganizationsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest + getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest build() { + com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest buildPartial() { + com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest result = + new com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest(this); + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.query_ = query_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest other) { + if (other + == com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest.getDefaultInstance()) + return this; + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of organizations to return in the response.
+     * If unspecified, server picks an appropriate default.
+     * 
+ * + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of organizations to return in the response.
+     * If unspecified, server picks an appropriate default.
+     * 
+ * + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of organizations to return in the response.
+     * If unspecified, server picks an appropriate default.
+     * 
+ * + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `SearchOrganizations`
+     * that indicates from where listing should continue.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `SearchOrganizations`
+     * that indicates from where listing should continue.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `SearchOrganizations`
+     * that indicates from where listing should continue.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `SearchOrganizations`
+     * that indicates from where listing should continue.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to `SearchOrganizations`
+     * that indicates from where listing should continue.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object 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`.
+     * 
+ * + * string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The query. + */ + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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`.
+     * 
+ * + * string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for query. + */ + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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`.
+     * 
+ * + * string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + query_ = value; + onChanged(); + 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`.
+     * 
+ * + * string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + + query_ = getDefaultInstance().getQuery(); + onChanged(); + 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`.
+     * 
+ * + * string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + public Builder setQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + query_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.SearchOrganizationsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.SearchOrganizationsRequest) + private static final com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest(); + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchOrganizationsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchOrganizationsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.SearchOrganizationsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchOrganizationsRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchOrganizationsRequestOrBuilder.java new file mode 100644 index 000000000000..e5f7bc62306f --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchOrganizationsRequestOrBuilder.java @@ -0,0 +1,115 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/organizations.proto + +package com.google.cloud.resourcemanager.v3; + +public interface SearchOrganizationsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.SearchOrganizationsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The maximum number of organizations to return in the response.
+   * If unspecified, server picks an appropriate default.
+   * 
+ * + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to `SearchOrganizations`
+   * that indicates from where listing should continue.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to `SearchOrganizations`
+   * that indicates from where listing should continue.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * 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`.
+   * 
+ * + * string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The query. + */ + java.lang.String getQuery(); + /** + * + * + *
+   * 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`.
+   * 
+ * + * string query = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchOrganizationsResponse.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchOrganizationsResponse.java new file mode 100644 index 000000000000..1995f380e508 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchOrganizationsResponse.java @@ -0,0 +1,1201 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/organizations.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The response returned from the `SearchOrganizations` method.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.SearchOrganizationsResponse} + */ +public final class SearchOrganizationsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.SearchOrganizationsResponse) + SearchOrganizationsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchOrganizationsResponse.newBuilder() to construct. + private SearchOrganizationsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchOrganizationsResponse() { + organizations_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchOrganizationsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchOrganizationsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + organizations_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + organizations_.add( + input.readMessage( + com.google.cloud.resourcemanager.v3.Organization.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + organizations_ = java.util.Collections.unmodifiableList(organizations_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_SearchOrganizationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_SearchOrganizationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse.class, + com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse.Builder.class); + } + + public static final int ORGANIZATIONS_FIELD_NUMBER = 1; + private java.util.List organizations_; + /** + * + * + *
+   * The list of Organizations that matched the search query, possibly
+   * paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + @java.lang.Override + public java.util.List getOrganizationsList() { + return organizations_; + } + /** + * + * + *
+   * The list of Organizations that matched the search query, possibly
+   * paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + @java.lang.Override + public java.util.List + getOrganizationsOrBuilderList() { + return organizations_; + } + /** + * + * + *
+   * The list of Organizations that matched the search query, possibly
+   * paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + @java.lang.Override + public int getOrganizationsCount() { + return organizations_.size(); + } + /** + * + * + *
+   * The list of Organizations that matched the search query, possibly
+   * paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Organization getOrganizations(int index) { + return organizations_.get(index); + } + /** + * + * + *
+   * The list of Organizations that matched the search query, possibly
+   * paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.OrganizationOrBuilder getOrganizationsOrBuilder( + int index) { + return organizations_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * 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.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * 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.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < organizations_.size(); i++) { + output.writeMessage(1, organizations_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < organizations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, organizations_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse other = + (com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse) obj; + + if (!getOrganizationsList().equals(other.getOrganizationsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getOrganizationsCount() > 0) { + hash = (37 * hash) + ORGANIZATIONS_FIELD_NUMBER; + hash = (53 * hash) + getOrganizationsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The response returned from the `SearchOrganizations` method.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.SearchOrganizationsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.SearchOrganizationsResponse) + com.google.cloud.resourcemanager.v3.SearchOrganizationsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_SearchOrganizationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_SearchOrganizationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse.class, + com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getOrganizationsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (organizationsBuilder_ == null) { + organizations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + organizationsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_SearchOrganizationsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse + getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse build() { + com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse buildPartial() { + com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse result = + new com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse(this); + int from_bitField0_ = bitField0_; + if (organizationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + organizations_ = java.util.Collections.unmodifiableList(organizations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.organizations_ = organizations_; + } else { + result.organizations_ = organizationsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse) { + return mergeFrom((com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse other) { + if (other + == com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse.getDefaultInstance()) + return this; + if (organizationsBuilder_ == null) { + if (!other.organizations_.isEmpty()) { + if (organizations_.isEmpty()) { + organizations_ = other.organizations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureOrganizationsIsMutable(); + organizations_.addAll(other.organizations_); + } + onChanged(); + } + } else { + if (!other.organizations_.isEmpty()) { + if (organizationsBuilder_.isEmpty()) { + organizationsBuilder_.dispose(); + organizationsBuilder_ = null; + organizations_ = other.organizations_; + bitField0_ = (bitField0_ & ~0x00000001); + organizationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getOrganizationsFieldBuilder() + : null; + } else { + organizationsBuilder_.addAllMessages(other.organizations_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List organizations_ = + java.util.Collections.emptyList(); + + private void ensureOrganizationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + organizations_ = + new java.util.ArrayList( + organizations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Organization, + com.google.cloud.resourcemanager.v3.Organization.Builder, + com.google.cloud.resourcemanager.v3.OrganizationOrBuilder> + organizationsBuilder_; + + /** + * + * + *
+     * The list of Organizations that matched the search query, possibly
+     * paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + public java.util.List getOrganizationsList() { + if (organizationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(organizations_); + } else { + return organizationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of Organizations that matched the search query, possibly
+     * paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + public int getOrganizationsCount() { + if (organizationsBuilder_ == null) { + return organizations_.size(); + } else { + return organizationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of Organizations that matched the search query, possibly
+     * paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + public com.google.cloud.resourcemanager.v3.Organization getOrganizations(int index) { + if (organizationsBuilder_ == null) { + return organizations_.get(index); + } else { + return organizationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of Organizations that matched the search query, possibly
+     * paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + public Builder setOrganizations( + int index, com.google.cloud.resourcemanager.v3.Organization value) { + if (organizationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOrganizationsIsMutable(); + organizations_.set(index, value); + onChanged(); + } else { + organizationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Organizations that matched the search query, possibly
+     * paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + public Builder setOrganizations( + int index, com.google.cloud.resourcemanager.v3.Organization.Builder builderForValue) { + if (organizationsBuilder_ == null) { + ensureOrganizationsIsMutable(); + organizations_.set(index, builderForValue.build()); + onChanged(); + } else { + organizationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Organizations that matched the search query, possibly
+     * paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + public Builder addOrganizations(com.google.cloud.resourcemanager.v3.Organization value) { + if (organizationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOrganizationsIsMutable(); + organizations_.add(value); + onChanged(); + } else { + organizationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of Organizations that matched the search query, possibly
+     * paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + public Builder addOrganizations( + int index, com.google.cloud.resourcemanager.v3.Organization value) { + if (organizationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOrganizationsIsMutable(); + organizations_.add(index, value); + onChanged(); + } else { + organizationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Organizations that matched the search query, possibly
+     * paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + public Builder addOrganizations( + com.google.cloud.resourcemanager.v3.Organization.Builder builderForValue) { + if (organizationsBuilder_ == null) { + ensureOrganizationsIsMutable(); + organizations_.add(builderForValue.build()); + onChanged(); + } else { + organizationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Organizations that matched the search query, possibly
+     * paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + public Builder addOrganizations( + int index, com.google.cloud.resourcemanager.v3.Organization.Builder builderForValue) { + if (organizationsBuilder_ == null) { + ensureOrganizationsIsMutable(); + organizations_.add(index, builderForValue.build()); + onChanged(); + } else { + organizationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Organizations that matched the search query, possibly
+     * paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + public Builder addAllOrganizations( + java.lang.Iterable values) { + if (organizationsBuilder_ == null) { + ensureOrganizationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, organizations_); + onChanged(); + } else { + organizationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of Organizations that matched the search query, possibly
+     * paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + public Builder clearOrganizations() { + if (organizationsBuilder_ == null) { + organizations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + organizationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of Organizations that matched the search query, possibly
+     * paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + public Builder removeOrganizations(int index) { + if (organizationsBuilder_ == null) { + ensureOrganizationsIsMutable(); + organizations_.remove(index); + onChanged(); + } else { + organizationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of Organizations that matched the search query, possibly
+     * paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + public com.google.cloud.resourcemanager.v3.Organization.Builder getOrganizationsBuilder( + int index) { + return getOrganizationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of Organizations that matched the search query, possibly
+     * paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + public com.google.cloud.resourcemanager.v3.OrganizationOrBuilder getOrganizationsOrBuilder( + int index) { + if (organizationsBuilder_ == null) { + return organizations_.get(index); + } else { + return organizationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of Organizations that matched the search query, possibly
+     * paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + public java.util.List + getOrganizationsOrBuilderList() { + if (organizationsBuilder_ != null) { + return organizationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(organizations_); + } + } + /** + * + * + *
+     * The list of Organizations that matched the search query, possibly
+     * paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + public com.google.cloud.resourcemanager.v3.Organization.Builder addOrganizationsBuilder() { + return getOrganizationsFieldBuilder() + .addBuilder(com.google.cloud.resourcemanager.v3.Organization.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Organizations that matched the search query, possibly
+     * paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + public com.google.cloud.resourcemanager.v3.Organization.Builder addOrganizationsBuilder( + int index) { + return getOrganizationsFieldBuilder() + .addBuilder(index, com.google.cloud.resourcemanager.v3.Organization.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Organizations that matched the search query, possibly
+     * paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + public java.util.List + getOrganizationsBuilderList() { + return getOrganizationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Organization, + com.google.cloud.resourcemanager.v3.Organization.Builder, + com.google.cloud.resourcemanager.v3.OrganizationOrBuilder> + getOrganizationsFieldBuilder() { + if (organizationsBuilder_ == null) { + organizationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Organization, + com.google.cloud.resourcemanager.v3.Organization.Builder, + com.google.cloud.resourcemanager.v3.OrganizationOrBuilder>( + organizations_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + organizations_ = null; + } + return organizationsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * 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.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + 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.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + 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.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.SearchOrganizationsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.SearchOrganizationsResponse) + private static final com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse(); + } + + public static com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchOrganizationsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchOrganizationsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.SearchOrganizationsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchOrganizationsResponseOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchOrganizationsResponseOrBuilder.java new file mode 100644 index 000000000000..6e8e6cce2e33 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchOrganizationsResponseOrBuilder.java @@ -0,0 +1,115 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/organizations.proto + +package com.google.cloud.resourcemanager.v3; + +public interface SearchOrganizationsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.SearchOrganizationsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of Organizations that matched the search query, possibly
+   * paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + java.util.List getOrganizationsList(); + /** + * + * + *
+   * The list of Organizations that matched the search query, possibly
+   * paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + com.google.cloud.resourcemanager.v3.Organization getOrganizations(int index); + /** + * + * + *
+   * The list of Organizations that matched the search query, possibly
+   * paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + int getOrganizationsCount(); + /** + * + * + *
+   * The list of Organizations that matched the search query, possibly
+   * paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + java.util.List + getOrganizationsOrBuilderList(); + /** + * + * + *
+   * The list of Organizations that matched the search query, possibly
+   * paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Organization organizations = 1; + */ + com.google.cloud.resourcemanager.v3.OrganizationOrBuilder getOrganizationsOrBuilder(int index); + + /** + * + * + *
+   * 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.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * 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.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchProjectsRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchProjectsRequest.java new file mode 100644 index 000000000000..ac4290d4b8a3 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchProjectsRequest.java @@ -0,0 +1,1135 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The request sent to the
+ * [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.SearchProjectsRequest} + */ +public final class SearchProjectsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.SearchProjectsRequest) + SearchProjectsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchProjectsRequest.newBuilder() to construct. + private SearchProjectsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchProjectsRequest() { + query_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchProjectsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchProjectsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + query_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_SearchProjectsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_SearchProjectsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.SearchProjectsRequest.class, + com.google.cloud.resourcemanager.v3.SearchProjectsRequest.Builder.class); + } + + public static final int QUERY_FIELD_NUMBER = 1; + private volatile java.lang.Object 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, the it will return results that match any of the
+   * fields. Some eligible fields are:
+   * | Field                   | Description                                  |
+   * |-------------------------|----------------------------------------------|
+   * | 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.<key> (where *key* is the name of a label) | Filters by label
+   * name. |
+   * Search expressions are case insensitive.
+   * Some examples queries:
+   * | Query            | Description                                         |
+   * |------------------|-----------------------------------------------------|
+   * | 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&nbsp;labels.size:big | The project's label `color` has
+   * the value `red` and 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.
+   * 
+ * + * string query = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The query. + */ + @java.lang.Override + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } + } + /** + * + * + *
+   * 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, the it will return results that match any of the
+   * fields. Some eligible fields are:
+   * | Field                   | Description                                  |
+   * |-------------------------|----------------------------------------------|
+   * | 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.<key> (where *key* is the name of a label) | Filters by label
+   * name. |
+   * Search expressions are case insensitive.
+   * Some examples queries:
+   * | Query            | Description                                         |
+   * |------------------|-----------------------------------------------------|
+   * | 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&nbsp;labels.size:big | The project's label `color` has
+   * the value `red` and 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.
+   * 
+ * + * string query = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for query. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to [ListProjects]
+   * [google.cloud.resourcemanager.v3.Projects.ListProjects]
+   * that indicates from where listing should continue.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to [ListProjects]
+   * [google.cloud.resourcemanager.v3.Projects.ListProjects]
+   * that indicates from where listing should continue.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * 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.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getQueryBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, query_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getQueryBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, query_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.SearchProjectsRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.SearchProjectsRequest other = + (com.google.cloud.resourcemanager.v3.SearchProjectsRequest) obj; + + if (!getQuery().equals(other.getQuery())) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.SearchProjectsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request sent to the
+   * [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.SearchProjectsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.SearchProjectsRequest) + com.google.cloud.resourcemanager.v3.SearchProjectsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_SearchProjectsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_SearchProjectsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.SearchProjectsRequest.class, + com.google.cloud.resourcemanager.v3.SearchProjectsRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.SearchProjectsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + query_ = ""; + + pageToken_ = ""; + + pageSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_SearchProjectsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.SearchProjectsRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.SearchProjectsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.SearchProjectsRequest build() { + com.google.cloud.resourcemanager.v3.SearchProjectsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.SearchProjectsRequest buildPartial() { + com.google.cloud.resourcemanager.v3.SearchProjectsRequest result = + new com.google.cloud.resourcemanager.v3.SearchProjectsRequest(this); + result.query_ = query_; + result.pageToken_ = pageToken_; + result.pageSize_ = pageSize_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.SearchProjectsRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.SearchProjectsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.SearchProjectsRequest other) { + if (other == com.google.cloud.resourcemanager.v3.SearchProjectsRequest.getDefaultInstance()) + return this; + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.SearchProjectsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.SearchProjectsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object 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, the it will return results that match any of the
+     * fields. Some eligible fields are:
+     * | Field                   | Description                                  |
+     * |-------------------------|----------------------------------------------|
+     * | 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.<key> (where *key* is the name of a label) | Filters by label
+     * name. |
+     * Search expressions are case insensitive.
+     * Some examples queries:
+     * | Query            | Description                                         |
+     * |------------------|-----------------------------------------------------|
+     * | 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&nbsp;labels.size:big | The project's label `color` has
+     * the value `red` and 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.
+     * 
+ * + * string query = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The query. + */ + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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, the it will return results that match any of the
+     * fields. Some eligible fields are:
+     * | Field                   | Description                                  |
+     * |-------------------------|----------------------------------------------|
+     * | 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.<key> (where *key* is the name of a label) | Filters by label
+     * name. |
+     * Search expressions are case insensitive.
+     * Some examples queries:
+     * | Query            | Description                                         |
+     * |------------------|-----------------------------------------------------|
+     * | 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&nbsp;labels.size:big | The project's label `color` has
+     * the value `red` and 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.
+     * 
+ * + * string query = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for query. + */ + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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, the it will return results that match any of the
+     * fields. Some eligible fields are:
+     * | Field                   | Description                                  |
+     * |-------------------------|----------------------------------------------|
+     * | 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.<key> (where *key* is the name of a label) | Filters by label
+     * name. |
+     * Search expressions are case insensitive.
+     * Some examples queries:
+     * | Query            | Description                                         |
+     * |------------------|-----------------------------------------------------|
+     * | 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&nbsp;labels.size:big | The project's label `color` has
+     * the value `red` and 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.
+     * 
+ * + * string query = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + query_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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, the it will return results that match any of the
+     * fields. Some eligible fields are:
+     * | Field                   | Description                                  |
+     * |-------------------------|----------------------------------------------|
+     * | 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.<key> (where *key* is the name of a label) | Filters by label
+     * name. |
+     * Search expressions are case insensitive.
+     * Some examples queries:
+     * | Query            | Description                                         |
+     * |------------------|-----------------------------------------------------|
+     * | 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&nbsp;labels.size:big | The project's label `color` has
+     * the value `red` and 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.
+     * 
+ * + * string query = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + + query_ = getDefaultInstance().getQuery(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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, the it will return results that match any of the
+     * fields. Some eligible fields are:
+     * | Field                   | Description                                  |
+     * |-------------------------|----------------------------------------------|
+     * | 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.<key> (where *key* is the name of a label) | Filters by label
+     * name. |
+     * Search expressions are case insensitive.
+     * Some examples queries:
+     * | Query            | Description                                         |
+     * |------------------|-----------------------------------------------------|
+     * | 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&nbsp;labels.size:big | The project's label `color` has
+     * the value `red` and 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.
+     * 
+ * + * string query = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + public Builder setQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + query_ = value; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to [ListProjects]
+     * [google.cloud.resourcemanager.v3.Projects.ListProjects]
+     * that indicates from where listing should continue.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to [ListProjects]
+     * [google.cloud.resourcemanager.v3.Projects.ListProjects]
+     * that indicates from where listing should continue.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A pagination token returned from a previous call to [ListProjects]
+     * [google.cloud.resourcemanager.v3.Projects.ListProjects]
+     * that indicates from where listing should continue.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + 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.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + 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.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * 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.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + 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.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.SearchProjectsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.SearchProjectsRequest) + private static final com.google.cloud.resourcemanager.v3.SearchProjectsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.SearchProjectsRequest(); + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchProjectsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchProjectsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.SearchProjectsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchProjectsRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchProjectsRequestOrBuilder.java new file mode 100644 index 000000000000..fb4e38295364 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchProjectsRequestOrBuilder.java @@ -0,0 +1,152 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +public interface SearchProjectsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.SearchProjectsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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, the it will return results that match any of the
+   * fields. Some eligible fields are:
+   * | Field                   | Description                                  |
+   * |-------------------------|----------------------------------------------|
+   * | 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.<key> (where *key* is the name of a label) | Filters by label
+   * name. |
+   * Search expressions are case insensitive.
+   * Some examples queries:
+   * | Query            | Description                                         |
+   * |------------------|-----------------------------------------------------|
+   * | 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&nbsp;labels.size:big | The project's label `color` has
+   * the value `red` and 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.
+   * 
+ * + * string query = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The query. + */ + java.lang.String getQuery(); + /** + * + * + *
+   * 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, the it will return results that match any of the
+   * fields. Some eligible fields are:
+   * | Field                   | Description                                  |
+   * |-------------------------|----------------------------------------------|
+   * | 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.<key> (where *key* is the name of a label) | Filters by label
+   * name. |
+   * Search expressions are case insensitive.
+   * Some examples queries:
+   * | Query            | Description                                         |
+   * |------------------|-----------------------------------------------------|
+   * | 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&nbsp;labels.size:big | The project's label `color` has
+   * the value `red` and 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.
+   * 
+ * + * string query = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to [ListProjects]
+   * [google.cloud.resourcemanager.v3.Projects.ListProjects]
+   * that indicates from where listing should continue.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A pagination token returned from a previous call to [ListProjects]
+   * [google.cloud.resourcemanager.v3.Projects.ListProjects]
+   * that indicates from where listing should continue.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchProjectsResponse.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchProjectsResponse.java new file mode 100644 index 000000000000..9ff3c575a5fc --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchProjectsResponse.java @@ -0,0 +1,1212 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * A page of the response received from the
+ * [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects]
+ * method.
+ * A paginated response where more pages are available has
+ * `next_page_token` set. This token can be used in a subsequent request to
+ * retrieve the next request page.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.SearchProjectsResponse} + */ +public final class SearchProjectsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.SearchProjectsResponse) + SearchProjectsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchProjectsResponse.newBuilder() to construct. + private SearchProjectsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchProjectsResponse() { + projects_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchProjectsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchProjectsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + projects_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + projects_.add( + input.readMessage( + com.google.cloud.resourcemanager.v3.Project.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + projects_ = java.util.Collections.unmodifiableList(projects_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_SearchProjectsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_SearchProjectsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.SearchProjectsResponse.class, + com.google.cloud.resourcemanager.v3.SearchProjectsResponse.Builder.class); + } + + public static final int PROJECTS_FIELD_NUMBER = 1; + private java.util.List projects_; + /** + * + * + *
+   * The list of Projects that matched the list filter query. This list can
+   * be paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + @java.lang.Override + public java.util.List getProjectsList() { + return projects_; + } + /** + * + * + *
+   * The list of Projects that matched the list filter query. This list can
+   * be paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + @java.lang.Override + public java.util.List + getProjectsOrBuilderList() { + return projects_; + } + /** + * + * + *
+   * The list of Projects that matched the list filter query. This list can
+   * be paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + @java.lang.Override + public int getProjectsCount() { + return projects_.size(); + } + /** + * + * + *
+   * The list of Projects that matched the list filter query. This list can
+   * be paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Project getProjects(int index) { + return projects_.get(index); + } + /** + * + * + *
+   * The list of Projects that matched the list filter query. This list can
+   * be paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ProjectOrBuilder getProjectsOrBuilder(int index) { + return projects_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * 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.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * 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.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < projects_.size(); i++) { + output.writeMessage(1, projects_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < projects_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, projects_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.SearchProjectsResponse)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.SearchProjectsResponse other = + (com.google.cloud.resourcemanager.v3.SearchProjectsResponse) obj; + + if (!getProjectsList().equals(other.getProjectsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getProjectsCount() > 0) { + hash = (37 * hash) + PROJECTS_FIELD_NUMBER; + hash = (53 * hash) + getProjectsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.SearchProjectsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A page of the response received from the
+   * [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects]
+   * method.
+   * A paginated response where more pages are available has
+   * `next_page_token` set. This token can be used in a subsequent request to
+   * retrieve the next request page.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.SearchProjectsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.SearchProjectsResponse) + com.google.cloud.resourcemanager.v3.SearchProjectsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_SearchProjectsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_SearchProjectsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.SearchProjectsResponse.class, + com.google.cloud.resourcemanager.v3.SearchProjectsResponse.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.SearchProjectsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getProjectsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (projectsBuilder_ == null) { + projects_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + projectsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_SearchProjectsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.SearchProjectsResponse getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.SearchProjectsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.SearchProjectsResponse build() { + com.google.cloud.resourcemanager.v3.SearchProjectsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.SearchProjectsResponse buildPartial() { + com.google.cloud.resourcemanager.v3.SearchProjectsResponse result = + new com.google.cloud.resourcemanager.v3.SearchProjectsResponse(this); + int from_bitField0_ = bitField0_; + if (projectsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + projects_ = java.util.Collections.unmodifiableList(projects_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.projects_ = projects_; + } else { + result.projects_ = projectsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.SearchProjectsResponse) { + return mergeFrom((com.google.cloud.resourcemanager.v3.SearchProjectsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.SearchProjectsResponse other) { + if (other == com.google.cloud.resourcemanager.v3.SearchProjectsResponse.getDefaultInstance()) + return this; + if (projectsBuilder_ == null) { + if (!other.projects_.isEmpty()) { + if (projects_.isEmpty()) { + projects_ = other.projects_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureProjectsIsMutable(); + projects_.addAll(other.projects_); + } + onChanged(); + } + } else { + if (!other.projects_.isEmpty()) { + if (projectsBuilder_.isEmpty()) { + projectsBuilder_.dispose(); + projectsBuilder_ = null; + projects_ = other.projects_; + bitField0_ = (bitField0_ & ~0x00000001); + projectsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getProjectsFieldBuilder() + : null; + } else { + projectsBuilder_.addAllMessages(other.projects_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.SearchProjectsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.SearchProjectsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List projects_ = + java.util.Collections.emptyList(); + + private void ensureProjectsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + projects_ = new java.util.ArrayList(projects_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Project, + com.google.cloud.resourcemanager.v3.Project.Builder, + com.google.cloud.resourcemanager.v3.ProjectOrBuilder> + projectsBuilder_; + + /** + * + * + *
+     * The list of Projects that matched the list filter query. This list can
+     * be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public java.util.List getProjectsList() { + if (projectsBuilder_ == null) { + return java.util.Collections.unmodifiableList(projects_); + } else { + return projectsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of Projects that matched the list filter query. This list can
+     * be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public int getProjectsCount() { + if (projectsBuilder_ == null) { + return projects_.size(); + } else { + return projectsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of Projects that matched the list filter query. This list can
+     * be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public com.google.cloud.resourcemanager.v3.Project getProjects(int index) { + if (projectsBuilder_ == null) { + return projects_.get(index); + } else { + return projectsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of Projects that matched the list filter query. This list can
+     * be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public Builder setProjects(int index, com.google.cloud.resourcemanager.v3.Project value) { + if (projectsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProjectsIsMutable(); + projects_.set(index, value); + onChanged(); + } else { + projectsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Projects that matched the list filter query. This list can
+     * be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public Builder setProjects( + int index, com.google.cloud.resourcemanager.v3.Project.Builder builderForValue) { + if (projectsBuilder_ == null) { + ensureProjectsIsMutable(); + projects_.set(index, builderForValue.build()); + onChanged(); + } else { + projectsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Projects that matched the list filter query. This list can
+     * be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public Builder addProjects(com.google.cloud.resourcemanager.v3.Project value) { + if (projectsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProjectsIsMutable(); + projects_.add(value); + onChanged(); + } else { + projectsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of Projects that matched the list filter query. This list can
+     * be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public Builder addProjects(int index, com.google.cloud.resourcemanager.v3.Project value) { + if (projectsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProjectsIsMutable(); + projects_.add(index, value); + onChanged(); + } else { + projectsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Projects that matched the list filter query. This list can
+     * be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public Builder addProjects( + com.google.cloud.resourcemanager.v3.Project.Builder builderForValue) { + if (projectsBuilder_ == null) { + ensureProjectsIsMutable(); + projects_.add(builderForValue.build()); + onChanged(); + } else { + projectsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Projects that matched the list filter query. This list can
+     * be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public Builder addProjects( + int index, com.google.cloud.resourcemanager.v3.Project.Builder builderForValue) { + if (projectsBuilder_ == null) { + ensureProjectsIsMutable(); + projects_.add(index, builderForValue.build()); + onChanged(); + } else { + projectsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Projects that matched the list filter query. This list can
+     * be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public Builder addAllProjects( + java.lang.Iterable values) { + if (projectsBuilder_ == null) { + ensureProjectsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, projects_); + onChanged(); + } else { + projectsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of Projects that matched the list filter query. This list can
+     * be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public Builder clearProjects() { + if (projectsBuilder_ == null) { + projects_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + projectsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of Projects that matched the list filter query. This list can
+     * be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public Builder removeProjects(int index) { + if (projectsBuilder_ == null) { + ensureProjectsIsMutable(); + projects_.remove(index); + onChanged(); + } else { + projectsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of Projects that matched the list filter query. This list can
+     * be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public com.google.cloud.resourcemanager.v3.Project.Builder getProjectsBuilder(int index) { + return getProjectsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of Projects that matched the list filter query. This list can
+     * be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public com.google.cloud.resourcemanager.v3.ProjectOrBuilder getProjectsOrBuilder(int index) { + if (projectsBuilder_ == null) { + return projects_.get(index); + } else { + return projectsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of Projects that matched the list filter query. This list can
+     * be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public java.util.List + getProjectsOrBuilderList() { + if (projectsBuilder_ != null) { + return projectsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(projects_); + } + } + /** + * + * + *
+     * The list of Projects that matched the list filter query. This list can
+     * be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public com.google.cloud.resourcemanager.v3.Project.Builder addProjectsBuilder() { + return getProjectsFieldBuilder() + .addBuilder(com.google.cloud.resourcemanager.v3.Project.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Projects that matched the list filter query. This list can
+     * be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public com.google.cloud.resourcemanager.v3.Project.Builder addProjectsBuilder(int index) { + return getProjectsFieldBuilder() + .addBuilder(index, com.google.cloud.resourcemanager.v3.Project.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Projects that matched the list filter query. This list can
+     * be paginated.
+     * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + public java.util.List + getProjectsBuilderList() { + return getProjectsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Project, + com.google.cloud.resourcemanager.v3.Project.Builder, + com.google.cloud.resourcemanager.v3.ProjectOrBuilder> + getProjectsFieldBuilder() { + if (projectsBuilder_ == null) { + projectsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Project, + com.google.cloud.resourcemanager.v3.Project.Builder, + com.google.cloud.resourcemanager.v3.ProjectOrBuilder>( + projects_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + projects_ = null; + } + return projectsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * 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.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + 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.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + 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.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.SearchProjectsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.SearchProjectsResponse) + private static final com.google.cloud.resourcemanager.v3.SearchProjectsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.SearchProjectsResponse(); + } + + public static com.google.cloud.resourcemanager.v3.SearchProjectsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchProjectsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchProjectsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.SearchProjectsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchProjectsResponseOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchProjectsResponseOrBuilder.java new file mode 100644 index 000000000000..59f55363f484 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/SearchProjectsResponseOrBuilder.java @@ -0,0 +1,121 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +public interface SearchProjectsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.SearchProjectsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of Projects that matched the list filter query. This list can
+   * be paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + java.util.List getProjectsList(); + /** + * + * + *
+   * The list of Projects that matched the list filter query. This list can
+   * be paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + com.google.cloud.resourcemanager.v3.Project getProjects(int index); + /** + * + * + *
+   * The list of Projects that matched the list filter query. This list can
+   * be paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + int getProjectsCount(); + /** + * + * + *
+   * The list of Projects that matched the list filter query. This list can
+   * be paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + java.util.List + getProjectsOrBuilderList(); + /** + * + * + *
+   * The list of Projects that matched the list filter query. This list can
+   * be paginated.
+   * 
+ * + * repeated .google.cloud.resourcemanager.v3.Project projects = 1; + */ + com.google.cloud.resourcemanager.v3.ProjectOrBuilder getProjectsOrBuilder(int index); + + /** + * + * + *
+   * 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.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * 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.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagBinding.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagBinding.java new file mode 100644 index 000000000000..1038d47b30f9 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagBinding.java @@ -0,0 +1,1026 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_bindings.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * A TagBinding represents a connection between a TagValue and a cloud
+ * resource (currently project, folder, or organization). Once a TagBinding is
+ * created, the TagValue is applied to all the descendants of the cloud
+ * resource.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.TagBinding} + */ +public final class TagBinding extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.TagBinding) + TagBindingOrBuilder { + private static final long serialVersionUID = 0L; + // Use TagBinding.newBuilder() to construct. + private TagBinding(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TagBinding() { + name_ = ""; + parent_ = ""; + tagValue_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TagBinding(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TagBinding( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + tagValue_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_TagBinding_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_TagBinding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.TagBinding.class, + com.google.cloud.resourcemanager.v3.TagBinding.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object 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`).
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * 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`).
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARENT_FIELD_NUMBER = 2; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * The full resource name of the resource the TagValue is bound to.
+   * E.g. `//cloudresourcemanager.googleapis.com/projects/123`
+   * 
+ * + * string parent = 2; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * The full resource name of the resource the TagValue is bound to.
+   * E.g. `//cloudresourcemanager.googleapis.com/projects/123`
+   * 
+ * + * string parent = 2; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TAG_VALUE_FIELD_NUMBER = 3; + private volatile java.lang.Object tagValue_; + /** + * + * + *
+   * The TagValue of the TagBinding.
+   * Must be of the form `tagValues/456`.
+   * 
+ * + * string tag_value = 3; + * + * @return The tagValue. + */ + @java.lang.Override + public java.lang.String getTagValue() { + java.lang.Object ref = tagValue_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tagValue_ = s; + return s; + } + } + /** + * + * + *
+   * The TagValue of the TagBinding.
+   * Must be of the form `tagValues/456`.
+   * 
+ * + * string tag_value = 3; + * + * @return The bytes for tagValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTagValueBytes() { + java.lang.Object ref = tagValue_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tagValue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, parent_); + } + if (!getTagValueBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, tagValue_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, parent_); + } + if (!getTagValueBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, tagValue_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.TagBinding)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.TagBinding other = + (com.google.cloud.resourcemanager.v3.TagBinding) obj; + + if (!getName().equals(other.getName())) return false; + if (!getParent().equals(other.getParent())) return false; + if (!getTagValue().equals(other.getTagValue())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + TAG_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getTagValue().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.TagBinding parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.TagBinding parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.TagBinding parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.TagBinding parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.TagBinding parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.TagBinding parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.TagBinding parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.TagBinding parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.TagBinding parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.TagBinding parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.TagBinding parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.TagBinding parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.resourcemanager.v3.TagBinding prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A TagBinding represents a connection between a TagValue and a cloud
+   * resource (currently project, folder, or organization). Once a TagBinding is
+   * created, the TagValue is applied to all the descendants of the cloud
+   * resource.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.TagBinding} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.TagBinding) + com.google.cloud.resourcemanager.v3.TagBindingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_TagBinding_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_TagBinding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.TagBinding.class, + com.google.cloud.resourcemanager.v3.TagBinding.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.TagBinding.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + parent_ = ""; + + tagValue_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagBindingsProto + .internal_static_google_cloud_resourcemanager_v3_TagBinding_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagBinding getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.TagBinding.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagBinding build() { + com.google.cloud.resourcemanager.v3.TagBinding result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagBinding buildPartial() { + com.google.cloud.resourcemanager.v3.TagBinding result = + new com.google.cloud.resourcemanager.v3.TagBinding(this); + result.name_ = name_; + result.parent_ = parent_; + result.tagValue_ = tagValue_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.TagBinding) { + return mergeFrom((com.google.cloud.resourcemanager.v3.TagBinding) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.TagBinding other) { + if (other == com.google.cloud.resourcemanager.v3.TagBinding.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getTagValue().isEmpty()) { + tagValue_ = other.tagValue_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.TagBinding parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.resourcemanager.v3.TagBinding) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object 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`).
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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`).
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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`).
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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`).
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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`).
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * The full resource name of the resource the TagValue is bound to.
+     * E.g. `//cloudresourcemanager.googleapis.com/projects/123`
+     * 
+ * + * string parent = 2; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The full resource name of the resource the TagValue is bound to.
+     * E.g. `//cloudresourcemanager.googleapis.com/projects/123`
+     * 
+ * + * string parent = 2; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The full resource name of the resource the TagValue is bound to.
+     * E.g. `//cloudresourcemanager.googleapis.com/projects/123`
+     * 
+ * + * string parent = 2; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The full resource name of the resource the TagValue is bound to.
+     * E.g. `//cloudresourcemanager.googleapis.com/projects/123`
+     * 
+ * + * string parent = 2; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * The full resource name of the resource the TagValue is bound to.
+     * E.g. `//cloudresourcemanager.googleapis.com/projects/123`
+     * 
+ * + * string parent = 2; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object tagValue_ = ""; + /** + * + * + *
+     * The TagValue of the TagBinding.
+     * Must be of the form `tagValues/456`.
+     * 
+ * + * string tag_value = 3; + * + * @return The tagValue. + */ + public java.lang.String getTagValue() { + java.lang.Object ref = tagValue_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tagValue_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The TagValue of the TagBinding.
+     * Must be of the form `tagValues/456`.
+     * 
+ * + * string tag_value = 3; + * + * @return The bytes for tagValue. + */ + public com.google.protobuf.ByteString getTagValueBytes() { + java.lang.Object ref = tagValue_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tagValue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The TagValue of the TagBinding.
+     * Must be of the form `tagValues/456`.
+     * 
+ * + * string tag_value = 3; + * + * @param value The tagValue to set. + * @return This builder for chaining. + */ + public Builder setTagValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + tagValue_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The TagValue of the TagBinding.
+     * Must be of the form `tagValues/456`.
+     * 
+ * + * string tag_value = 3; + * + * @return This builder for chaining. + */ + public Builder clearTagValue() { + + tagValue_ = getDefaultInstance().getTagValue(); + onChanged(); + return this; + } + /** + * + * + *
+     * The TagValue of the TagBinding.
+     * Must be of the form `tagValues/456`.
+     * 
+ * + * string tag_value = 3; + * + * @param value The bytes for tagValue to set. + * @return This builder for chaining. + */ + public Builder setTagValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + tagValue_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.TagBinding) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.TagBinding) + private static final com.google.cloud.resourcemanager.v3.TagBinding DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.TagBinding(); + } + + public static com.google.cloud.resourcemanager.v3.TagBinding getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TagBinding parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TagBinding(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagBinding getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagBindingName.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagBindingName.java new file mode 100644 index 000000000000..180fc4ec8514 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagBindingName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class TagBindingName implements ResourceName { + private static final PathTemplate TAG_BINDING = + PathTemplate.createWithoutUrlEncoding("tagBindings/{tag_binding}"); + private volatile Map fieldValuesMap; + private final String tagBinding; + + @Deprecated + protected TagBindingName() { + tagBinding = null; + } + + private TagBindingName(Builder builder) { + tagBinding = Preconditions.checkNotNull(builder.getTagBinding()); + } + + public String getTagBinding() { + return tagBinding; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static TagBindingName of(String tagBinding) { + return newBuilder().setTagBinding(tagBinding).build(); + } + + public static String format(String tagBinding) { + return newBuilder().setTagBinding(tagBinding).build().toString(); + } + + public static TagBindingName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + TAG_BINDING.validatedMatch( + formattedString, "TagBindingName.parse: formattedString not in valid format"); + return of(matchMap.get("tag_binding")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (TagBindingName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return TAG_BINDING.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (tagBinding != null) { + fieldMapBuilder.put("tag_binding", tagBinding); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return TAG_BINDING.instantiate("tag_binding", tagBinding); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + TagBindingName that = ((TagBindingName) o); + return Objects.equals(this.tagBinding, that.tagBinding); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(tagBinding); + return h; + } + + /** Builder for tagBindings/{tag_binding}. */ + public static class Builder { + private String tagBinding; + + protected Builder() {} + + public String getTagBinding() { + return tagBinding; + } + + public Builder setTagBinding(String tagBinding) { + this.tagBinding = tagBinding; + return this; + } + + private Builder(TagBindingName tagBindingName) { + tagBinding = tagBindingName.tagBinding; + } + + public TagBindingName build() { + return new TagBindingName(this); + } + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagBindingOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagBindingOrBuilder.java new file mode 100644 index 000000000000..503daf541dfd --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagBindingOrBuilder.java @@ -0,0 +1,108 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_bindings.proto + +package com.google.cloud.resourcemanager.v3; + +public interface TagBindingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.TagBinding) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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`).
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * 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`).
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The full resource name of the resource the TagValue is bound to.
+   * E.g. `//cloudresourcemanager.googleapis.com/projects/123`
+   * 
+ * + * string parent = 2; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * The full resource name of the resource the TagValue is bound to.
+   * E.g. `//cloudresourcemanager.googleapis.com/projects/123`
+   * 
+ * + * string parent = 2; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The TagValue of the TagBinding.
+   * Must be of the form `tagValues/456`.
+   * 
+ * + * string tag_value = 3; + * + * @return The tagValue. + */ + java.lang.String getTagValue(); + /** + * + * + *
+   * The TagValue of the TagBinding.
+   * Must be of the form `tagValues/456`.
+   * 
+ * + * string tag_value = 3; + * + * @return The bytes for tagValue. + */ + com.google.protobuf.ByteString getTagValueBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagBindingsProto.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagBindingsProto.java new file mode 100644 index 000000000000..8461cd96126b --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagBindingsProto.java @@ -0,0 +1,197 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_bindings.proto + +package com.google.cloud.resourcemanager.v3; + +public final class TagBindingsProto { + private TagBindingsProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_TagBinding_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_TagBinding_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_CreateTagBindingMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_CreateTagBindingMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_CreateTagBindingRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_CreateTagBindingRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_DeleteTagBindingMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_DeleteTagBindingMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_DeleteTagBindingRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_DeleteTagBindingRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_ListTagBindingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_ListTagBindingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_ListTagBindingsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_ListTagBindingsResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n2google/cloud/resourcemanager/v3/tag_bi" + + "ndings.proto\022\037google.cloud.resourcemanag" + + "er.v3\032\034google/api/annotations.proto\032\027goo" + + "gle/api/client.proto\032\037google/api/field_b" + + "ehavior.proto\032\031google/api/resource.proto" + + "\032#google/longrunning/operations.proto\"\222\001" + + "\n\nTagBinding\022\021\n\004name\030\001 \001(\tB\003\340A\003\022\016\n\006paren" + + "t\030\002 \001(\t\022\021\n\ttag_value\030\003 \001(\t:N\352AK\n.cloudre" + + "sourcemanager.googleapis.com/TagBinding\022" + + "\031tagBindings/{tag_binding}\"\032\n\030CreateTagB" + + "indingMetadata\"|\n\027CreateTagBindingReques" + + "t\022E\n\013tag_binding\030\001 \001(\0132+.google.cloud.re" + + "sourcemanager.v3.TagBindingB\003\340A\002\022\032\n\rvali" + + "date_only\030\002 \001(\010B\003\340A\001\"\032\n\030DeleteTagBinding" + + "Metadata\"_\n\027DeleteTagBindingRequest\022D\n\004n" + + "ame\030\001 \001(\tB6\340A\002\372A0\n.cloudresourcemanager." + + "googleapis.com/TagBinding\"d\n\026ListTagBind" + + "ingsRequest\022\031\n\006parent\030\001 \001(\tB\t\340A\002\372A\003\022\001*\022\026" + + "\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\npage_token\030\003 \001" + + "(\tB\003\340A\001\"u\n\027ListTagBindingsResponse\022A\n\014ta" + + "g_bindings\030\001 \003(\0132+.google.cloud.resource" + + "manager.v3.TagBinding\022\027\n\017next_page_token" + + "\030\002 \001(\t2\340\005\n\013TagBindings\022\246\001\n\017ListTagBindin" + + "gs\0227.google.cloud.resourcemanager.v3.Lis" + + "tTagBindingsRequest\0328.google.cloud.resou" + + "rcemanager.v3.ListTagBindingsResponse\" \202" + + "\323\344\223\002\021\022\017/v3/tagBindings\332A\006parent\022\310\001\n\020Crea" + + "teTagBinding\0228.google.cloud.resourcemana" + + "ger.v3.CreateTagBindingRequest\032\035.google." + + "longrunning.Operation\"[\202\323\344\223\002\036\"\017/v3/tagBi" + + "ndings:\013tag_binding\332A\013tag_binding\312A&\n\nTa" + + "gBinding\022\030CreateTagBindingMetadata\022\311\001\n\020D" + + "eleteTagBinding\0228.google.cloud.resourcem" + + "anager.v3.DeleteTagBindingRequest\032\035.goog" + + "le.longrunning.Operation\"\\\202\323\344\223\002\033*\031/v3/{n" + + "ame=tagBindings/**}\332A\004name\312A1\n\025google.pr" + + "otobuf.Empty\022\030DeleteTagBindingMetadata\032\220" + + "\001\312A#cloudresourcemanager.googleapis.com\322" + + "Aghttps://www.googleapis.com/auth/cloud-" + + "platform,https://www.googleapis.com/auth" + + "/cloud-platform.read-onlyB\315\001\n#com.google" + + ".cloud.resourcemanager.v3B\020TagBindingsPr" + + "otoP\001ZNgoogle.golang.org/genproto/google" + + "apis/cloud/resourcemanager/v3;resourcema" + + "nager\252\002\037Google.Cloud.ResourceManager.V3\312" + + "\002\037Google\\Cloud\\ResourceManager\\V3b\006proto" + + "3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + }); + internal_static_google_cloud_resourcemanager_v3_TagBinding_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_resourcemanager_v3_TagBinding_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_TagBinding_descriptor, + new java.lang.String[] { + "Name", "Parent", "TagValue", + }); + internal_static_google_cloud_resourcemanager_v3_CreateTagBindingMetadata_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_resourcemanager_v3_CreateTagBindingMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_CreateTagBindingMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_resourcemanager_v3_CreateTagBindingRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_resourcemanager_v3_CreateTagBindingRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_CreateTagBindingRequest_descriptor, + new java.lang.String[] { + "TagBinding", "ValidateOnly", + }); + internal_static_google_cloud_resourcemanager_v3_DeleteTagBindingMetadata_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_resourcemanager_v3_DeleteTagBindingMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_DeleteTagBindingMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_resourcemanager_v3_DeleteTagBindingRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_resourcemanager_v3_DeleteTagBindingRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_DeleteTagBindingRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_resourcemanager_v3_ListTagBindingsRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_resourcemanager_v3_ListTagBindingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_ListTagBindingsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_resourcemanager_v3_ListTagBindingsResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_resourcemanager_v3_ListTagBindingsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_ListTagBindingsResponse_descriptor, + new java.lang.String[] { + "TagBindings", "NextPageToken", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagKey.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagKey.java new file mode 100644 index 000000000000..b70a7e160545 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagKey.java @@ -0,0 +1,2206 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_keys.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * A TagKey, used to group a set of TagValues.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.TagKey} + */ +public final class TagKey extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.TagKey) + TagKeyOrBuilder { + private static final long serialVersionUID = 0L; + // Use TagKey.newBuilder() to construct. + private TagKey(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TagKey() { + name_ = ""; + parent_ = ""; + shortName_ = ""; + namespacedName_ = ""; + description_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TagKey(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TagKey( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + shortName_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + namespacedName_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 50: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 58: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + etag_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_TagKey_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_TagKey_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.TagKey.class, + com.google.cloud.resourcemanager.v3.TagKey.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object 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.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * 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.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARENT_FIELD_NUMBER = 2; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Immutable. The resource name of the new TagKey's parent.
+   * Must be of the form `organizations/{org_id}`.
+   * 
+ * + * string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. The resource name of the new TagKey's parent.
+   * Must be of the form `organizations/{org_id}`.
+   * 
+ * + * string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SHORT_NAME_FIELD_NUMBER = 3; + private volatile java.lang.Object shortName_; + /** + * + * + *
+   * 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.
+   * 
+ * + * + * string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The shortName. + */ + @java.lang.Override + public java.lang.String getShortName() { + java.lang.Object ref = shortName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + shortName_ = s; + return s; + } + } + /** + * + * + *
+   * 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.
+   * 
+ * + * + * string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for shortName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getShortNameBytes() { + java.lang.Object ref = shortName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + shortName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAMESPACED_NAME_FIELD_NUMBER = 4; + private volatile java.lang.Object namespacedName_; + /** + * + * + *
+   * Output only. Immutable. Namespaced name of the TagKey.
+   * 
+ * + * + * string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The namespacedName. + */ + @java.lang.Override + public java.lang.String getNamespacedName() { + java.lang.Object ref = namespacedName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + namespacedName_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Immutable. Namespaced name of the TagKey.
+   * 
+ * + * + * string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for namespacedName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNamespacedNameBytes() { + java.lang.Object ref = namespacedName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + namespacedName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 5; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Optional. User-assigned description of the TagKey. Must not exceed 256 characters.
+   * Read-write.
+   * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. User-assigned description of the TagKey. Must not exceed 256 characters.
+   * Read-write.
+   * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Update time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Update time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Update time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int ETAG_FIELD_NUMBER = 8; + private volatile java.lang.Object etag_; + /** + * + * + *
+   * Optional. Entity tag which users can pass to prevent race conditions. This field is
+   * always set in server responses. See UpdateTagKeyRequest for details.
+   * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Entity tag which users can pass to prevent race conditions. This field is
+   * always set in server responses. See UpdateTagKeyRequest for details.
+   * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, parent_); + } + if (!getShortNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, shortName_); + } + if (!getNamespacedNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, namespacedName_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, description_); + } + if (createTime_ != null) { + output.writeMessage(6, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(7, getUpdateTime()); + } + if (!getEtagBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, etag_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, parent_); + } + if (!getShortNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, shortName_); + } + if (!getNamespacedNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, namespacedName_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, description_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getUpdateTime()); + } + if (!getEtagBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, etag_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.TagKey)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.TagKey other = + (com.google.cloud.resourcemanager.v3.TagKey) obj; + + if (!getName().equals(other.getName())) return false; + if (!getParent().equals(other.getParent())) return false; + if (!getShortName().equals(other.getShortName())) return false; + if (!getNamespacedName().equals(other.getNamespacedName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!getEtag().equals(other.getEtag())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + SHORT_NAME_FIELD_NUMBER; + hash = (53 * hash) + getShortName().hashCode(); + hash = (37 * hash) + NAMESPACED_NAME_FIELD_NUMBER; + hash = (53 * hash) + getNamespacedName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.TagKey parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.TagKey parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.TagKey parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.TagKey parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.TagKey parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.TagKey parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.TagKey parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.TagKey parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.TagKey parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.TagKey parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.TagKey parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.TagKey parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.resourcemanager.v3.TagKey prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A TagKey, used to group a set of TagValues.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.TagKey} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.TagKey) + com.google.cloud.resourcemanager.v3.TagKeyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_TagKey_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_TagKey_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.TagKey.class, + com.google.cloud.resourcemanager.v3.TagKey.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.TagKey.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + parent_ = ""; + + shortName_ = ""; + + namespacedName_ = ""; + + description_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + etag_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_TagKey_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagKey getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.TagKey.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagKey build() { + com.google.cloud.resourcemanager.v3.TagKey result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagKey buildPartial() { + com.google.cloud.resourcemanager.v3.TagKey result = + new com.google.cloud.resourcemanager.v3.TagKey(this); + result.name_ = name_; + result.parent_ = parent_; + result.shortName_ = shortName_; + result.namespacedName_ = namespacedName_; + result.description_ = description_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.etag_ = etag_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.TagKey) { + return mergeFrom((com.google.cloud.resourcemanager.v3.TagKey) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.TagKey other) { + if (other == com.google.cloud.resourcemanager.v3.TagKey.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getShortName().isEmpty()) { + shortName_ = other.shortName_; + onChanged(); + } + if (!other.getNamespacedName().isEmpty()) { + namespacedName_ = other.namespacedName_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.TagKey parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.resourcemanager.v3.TagKey) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object 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.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Immutable. The resource name of the new TagKey's parent.
+     * Must be of the form `organizations/{org_id}`.
+     * 
+ * + * string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. The resource name of the new TagKey's parent.
+     * Must be of the form `organizations/{org_id}`.
+     * 
+ * + * string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. The resource name of the new TagKey's parent.
+     * Must be of the form `organizations/{org_id}`.
+     * 
+ * + * string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The resource name of the new TagKey's parent.
+     * Must be of the form `organizations/{org_id}`.
+     * 
+ * + * string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The resource name of the new TagKey's parent.
+     * Must be of the form `organizations/{org_id}`.
+     * 
+ * + * string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object shortName_ = ""; + /** + * + * + *
+     * 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.
+     * 
+ * + * + * string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The shortName. + */ + public java.lang.String getShortName() { + java.lang.Object ref = shortName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + shortName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for shortName. + */ + public com.google.protobuf.ByteString getShortNameBytes() { + java.lang.Object ref = shortName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + shortName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The shortName to set. + * @return This builder for chaining. + */ + public Builder setShortName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + shortName_ = value; + onChanged(); + 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.
+     * 
+ * + * + * string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearShortName() { + + shortName_ = getDefaultInstance().getShortName(); + onChanged(); + 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.
+     * 
+ * + * + * string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for shortName to set. + * @return This builder for chaining. + */ + public Builder setShortNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + shortName_ = value; + onChanged(); + return this; + } + + private java.lang.Object namespacedName_ = ""; + /** + * + * + *
+     * Output only. Immutable. Namespaced name of the TagKey.
+     * 
+ * + * + * string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The namespacedName. + */ + public java.lang.String getNamespacedName() { + java.lang.Object ref = namespacedName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + namespacedName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. Namespaced name of the TagKey.
+     * 
+ * + * + * string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for namespacedName. + */ + public com.google.protobuf.ByteString getNamespacedNameBytes() { + java.lang.Object ref = namespacedName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + namespacedName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. Namespaced name of the TagKey.
+     * 
+ * + * + * string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The namespacedName to set. + * @return This builder for chaining. + */ + public Builder setNamespacedName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + namespacedName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. Namespaced name of the TagKey.
+     * 
+ * + * + * string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearNamespacedName() { + + namespacedName_ = getDefaultInstance().getNamespacedName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. Namespaced name of the TagKey.
+     * 
+ * + * + * string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for namespacedName to set. + * @return This builder for chaining. + */ + public Builder setNamespacedNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + namespacedName_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Optional. User-assigned description of the TagKey. Must not exceed 256 characters.
+     * Read-write.
+     * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. User-assigned description of the TagKey. Must not exceed 256 characters.
+     * Read-write.
+     * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. User-assigned description of the TagKey. Must not exceed 256 characters.
+     * Read-write.
+     * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. User-assigned description of the TagKey. Must not exceed 256 characters.
+     * Read-write.
+     * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. User-assigned description of the TagKey. Must not exceed 256 characters.
+     * Read-write.
+     * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Update time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. Update time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Update time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Update time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Update time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Update time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Update time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Update time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Update time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. Entity tag which users can pass to prevent race conditions. This field is
+     * always set in server responses. See UpdateTagKeyRequest for details.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Entity tag which users can pass to prevent race conditions. This field is
+     * always set in server responses. See UpdateTagKeyRequest for details.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Entity tag which users can pass to prevent race conditions. This field is
+     * always set in server responses. See UpdateTagKeyRequest for details.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + etag_ = value; + onChanged(); + 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.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + + etag_ = getDefaultInstance().getEtag(); + onChanged(); + 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.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + etag_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.TagKey) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.TagKey) + private static final com.google.cloud.resourcemanager.v3.TagKey DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.TagKey(); + } + + public static com.google.cloud.resourcemanager.v3.TagKey getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TagKey parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TagKey(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagKey getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagKeyName.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagKeyName.java new file mode 100644 index 000000000000..bea5868c4ff7 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagKeyName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class TagKeyName implements ResourceName { + private static final PathTemplate TAG_KEY = + PathTemplate.createWithoutUrlEncoding("tagKeys/{tag_key}"); + private volatile Map fieldValuesMap; + private final String tagKey; + + @Deprecated + protected TagKeyName() { + tagKey = null; + } + + private TagKeyName(Builder builder) { + tagKey = Preconditions.checkNotNull(builder.getTagKey()); + } + + public String getTagKey() { + return tagKey; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static TagKeyName of(String tagKey) { + return newBuilder().setTagKey(tagKey).build(); + } + + public static String format(String tagKey) { + return newBuilder().setTagKey(tagKey).build().toString(); + } + + public static TagKeyName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + TAG_KEY.validatedMatch( + formattedString, "TagKeyName.parse: formattedString not in valid format"); + return of(matchMap.get("tag_key")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (TagKeyName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return TAG_KEY.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (tagKey != null) { + fieldMapBuilder.put("tag_key", tagKey); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return TAG_KEY.instantiate("tag_key", tagKey); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + TagKeyName that = ((TagKeyName) o); + return Objects.equals(this.tagKey, that.tagKey); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(tagKey); + return h; + } + + /** Builder for tagKeys/{tag_key}. */ + public static class Builder { + private String tagKey; + + protected Builder() {} + + public String getTagKey() { + return tagKey; + } + + public Builder setTagKey(String tagKey) { + this.tagKey = tagKey; + return this; + } + + private Builder(TagKeyName tagKeyName) { + tagKey = tagKeyName.tagKey; + } + + public TagKeyName build() { + return new TagKeyName(this); + } + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagKeyOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagKeyOrBuilder.java new file mode 100644 index 000000000000..ef8ed8fc643a --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagKeyOrBuilder.java @@ -0,0 +1,277 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_keys.proto + +package com.google.cloud.resourcemanager.v3; + +public interface TagKeyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.TagKey) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * 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.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Immutable. The resource name of the new TagKey's parent.
+   * Must be of the form `organizations/{org_id}`.
+   * 
+ * + * string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Immutable. The resource name of the new TagKey's parent.
+   * Must be of the form `organizations/{org_id}`.
+   * 
+ * + * string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * + * string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The shortName. + */ + java.lang.String getShortName(); + /** + * + * + *
+   * 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.
+   * 
+ * + * + * string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for shortName. + */ + com.google.protobuf.ByteString getShortNameBytes(); + + /** + * + * + *
+   * Output only. Immutable. Namespaced name of the TagKey.
+   * 
+ * + * + * string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The namespacedName. + */ + java.lang.String getNamespacedName(); + /** + * + * + *
+   * Output only. Immutable. Namespaced name of the TagKey.
+   * 
+ * + * + * string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for namespacedName. + */ + com.google.protobuf.ByteString getNamespacedNameBytes(); + + /** + * + * + *
+   * Optional. User-assigned description of the TagKey. Must not exceed 256 characters.
+   * Read-write.
+   * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Optional. User-assigned description of the TagKey. Must not exceed 256 characters.
+   * Read-write.
+   * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. Creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Update time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Update time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Update time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Optional. Entity tag which users can pass to prevent race conditions. This field is
+   * always set in server responses. See UpdateTagKeyRequest for details.
+   * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. Entity tag which users can pass to prevent race conditions. This field is
+   * always set in server responses. See UpdateTagKeyRequest for details.
+   * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagKeysProto.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagKeysProto.java new file mode 100644 index 000000000000..647a925bd4c7 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagKeysProto.java @@ -0,0 +1,278 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_keys.proto + +package com.google.cloud.resourcemanager.v3; + +public final class TagKeysProto { + private TagKeysProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_TagKey_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_TagKey_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_ListTagKeysRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_ListTagKeysRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_ListTagKeysResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_ListTagKeysResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_GetTagKeyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_GetTagKeyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_CreateTagKeyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_CreateTagKeyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_CreateTagKeyMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_CreateTagKeyMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_UpdateTagKeyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_UpdateTagKeyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_UpdateTagKeyMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_UpdateTagKeyMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_DeleteTagKeyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_DeleteTagKeyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_DeleteTagKeyMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_DeleteTagKeyMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n.google/cloud/resourcemanager/v3/tag_ke" + + "ys.proto\022\037google.cloud.resourcemanager.v" + + "3\032\034google/api/annotations.proto\032\027google/" + + "api/client.proto\032\037google/api/field_behav" + + "ior.proto\032\031google/api/resource.proto\032\036go" + + "ogle/iam/v1/iam_policy.proto\032\032google/iam" + + "/v1/policy.proto\032#google/longrunning/ope" + + "rations.proto\032 google/protobuf/field_mas" + + "k.proto\032\037google/protobuf/timestamp.proto" + + "\"\315\002\n\006TagKey\022\021\n\004name\030\001 \001(\tB\003\340A\005\022\023\n\006parent" + + "\030\002 \001(\tB\003\340A\005\022\032\n\nshort_name\030\003 \001(\tB\006\340A\002\340A\005\022" + + "\037\n\017namespaced_name\030\004 \001(\tB\006\340A\003\340A\005\022\030\n\013desc" + + "ription\030\005 \001(\tB\003\340A\001\0224\n\013create_time\030\006 \001(\0132" + + "\032.google.protobuf.TimestampB\003\340A\003\0224\n\013upda" + + "te_time\030\007 \001(\0132\032.google.protobuf.Timestam" + + "pB\003\340A\003\022\021\n\004etag\030\010 \001(\tB\003\340A\001:E\352AB\n*cloudres" + + "ourcemanager.googleapis.com/TagKey\022\021tagK" + + "eys/{tag_key}R\001\001\"`\n\022ListTagKeysRequest\022\031" + + "\n\006parent\030\001 \001(\tB\t\340A\002\372A\003\022\001*\022\026\n\tpage_size\030\002" + + " \001(\005B\003\340A\001\022\027\n\npage_token\030\003 \001(\tB\003\340A\001\"i\n\023Li" + + "stTagKeysResponse\0229\n\010tag_keys\030\001 \003(\0132\'.go" + + "ogle.cloud.resourcemanager.v3.TagKey\022\027\n\017" + + "next_page_token\030\002 \001(\t\"T\n\020GetTagKeyReques" + + "t\022@\n\004name\030\001 \001(\tB2\340A\002\372A,\n*cloudresourcema" + + "nager.googleapis.com/TagKey\"p\n\023CreateTag" + + "KeyRequest\022=\n\007tag_key\030\001 \001(\0132\'.google.clo" + + "ud.resourcemanager.v3.TagKeyB\003\340A\002\022\032\n\rval" + + "idate_only\030\002 \001(\010B\003\340A\001\"\026\n\024CreateTagKeyMet" + + "adata\"\234\001\n\023UpdateTagKeyRequest\022=\n\007tag_key" + + "\030\001 \001(\0132\'.google.cloud.resourcemanager.v3" + + ".TagKeyB\003\340A\002\022/\n\013update_mask\030\002 \001(\0132\032.goog" + + "le.protobuf.FieldMask\022\025\n\rvalidate_only\030\003" + + " \001(\010\"\026\n\024UpdateTagKeyMetadata\"\206\001\n\023DeleteT" + + "agKeyRequest\022@\n\004name\030\001 \001(\tB2\340A\002\372A,\n*clou" + + "dresourcemanager.googleapis.com/TagKey\022\032" + + "\n\rvalidate_only\030\002 \001(\010B\003\340A\001\022\021\n\004etag\030\003 \001(\t" + + "B\003\340A\001\"\026\n\024DeleteTagKeyMetadata2\277\013\n\007TagKey" + + "s\022\226\001\n\013ListTagKeys\0223.google.cloud.resourc" + + "emanager.v3.ListTagKeysRequest\0324.google." + + "cloud.resourcemanager.v3.ListTagKeysResp" + + "onse\"\034\202\323\344\223\002\r\022\013/v3/tagKeys\332A\006parent\022\214\001\n\tG" + + "etTagKey\0221.google.cloud.resourcemanager." + + "v3.GetTagKeyRequest\032\'.google.cloud.resou" + + "rcemanager.v3.TagKey\"#\202\323\344\223\002\026\022\024/v3/{name=" + + "tagKeys/*}\332A\004name\022\254\001\n\014CreateTagKey\0224.goo" + + "gle.cloud.resourcemanager.v3.CreateTagKe" + + "yRequest\032\035.google.longrunning.Operation\"" + + "G\202\323\344\223\002\026\"\013/v3/tagKeys:\007tag_key\332A\007tag_key\312" + + "A\036\n\006TagKey\022\024CreateTagKeyMetadata\022\311\001\n\014Upd" + + "ateTagKey\0224.google.cloud.resourcemanager" + + ".v3.UpdateTagKeyRequest\032\035.google.longrun" + + "ning.Operation\"d\202\323\344\223\002\'2\034/v3/{tag_key.nam" + + "e=tagKeys/*}:\007tag_key\332A\023tag_key,update_m" + + "ask\312A\036\n\006TagKey\022\024UpdateTagKeyMetadata\022\251\001\n" + + "\014DeleteTagKey\0224.google.cloud.resourceman" + + "ager.v3.DeleteTagKeyRequest\032\035.google.lon" + + "grunning.Operation\"D\202\323\344\223\002\026*\024/v3/{name=ta" + + "gKeys/*}\332A\004name\312A\036\n\006TagKey\022\024DeleteTagKey" + + "Metadata\022\206\001\n\014GetIamPolicy\022\".google.iam.v" + + "1.GetIamPolicyRequest\032\025.google.iam.v1.Po" + + "licy\";\202\323\344\223\002*\"%/v3/{resource=tagKeys/*}:g" + + "etIamPolicy:\001*\332A\010resource\022\215\001\n\014SetIamPoli" + + "cy\022\".google.iam.v1.SetIamPolicyRequest\032\025" + + ".google.iam.v1.Policy\"B\202\323\344\223\002*\"%/v3/{reso" + + "urce=tagKeys/*}:setIamPolicy:\001*\332A\017resour" + + "ce,policy\022\270\001\n\022TestIamPermissions\022(.googl" + + "e.iam.v1.TestIamPermissionsRequest\032).goo" + + "gle.iam.v1.TestIamPermissionsResponse\"M\202" + + "\323\344\223\0020\"+/v3/{resource=tagKeys/*}:testIamP" + + "ermissions:\001*\332A\024resource,permissions\032\220\001\312" + + "A#cloudresourcemanager.googleapis.com\322Ag" + + "https://www.googleapis.com/auth/cloud-pl" + + "atform,https://www.googleapis.com/auth/c" + + "loud-platform.read-onlyB\311\001\n#com.google.c" + + "loud.resourcemanager.v3B\014TagKeysProtoP\001Z" + + "Ngoogle.golang.org/genproto/googleapis/c" + + "loud/resourcemanager/v3;resourcemanager\252" + + "\002\037Google.Cloud.ResourceManager.V3\312\002\037Goog" + + "le\\Cloud\\ResourceManager\\V3b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.iam.v1.IamPolicyProto.getDescriptor(), + com.google.iam.v1.PolicyProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_resourcemanager_v3_TagKey_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_resourcemanager_v3_TagKey_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_TagKey_descriptor, + new java.lang.String[] { + "Name", + "Parent", + "ShortName", + "NamespacedName", + "Description", + "CreateTime", + "UpdateTime", + "Etag", + }); + internal_static_google_cloud_resourcemanager_v3_ListTagKeysRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_resourcemanager_v3_ListTagKeysRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_ListTagKeysRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_resourcemanager_v3_ListTagKeysResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_resourcemanager_v3_ListTagKeysResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_ListTagKeysResponse_descriptor, + new java.lang.String[] { + "TagKeys", "NextPageToken", + }); + internal_static_google_cloud_resourcemanager_v3_GetTagKeyRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_resourcemanager_v3_GetTagKeyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_GetTagKeyRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_resourcemanager_v3_CreateTagKeyRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_resourcemanager_v3_CreateTagKeyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_CreateTagKeyRequest_descriptor, + new java.lang.String[] { + "TagKey", "ValidateOnly", + }); + internal_static_google_cloud_resourcemanager_v3_CreateTagKeyMetadata_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_resourcemanager_v3_CreateTagKeyMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_CreateTagKeyMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_resourcemanager_v3_UpdateTagKeyRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_resourcemanager_v3_UpdateTagKeyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_UpdateTagKeyRequest_descriptor, + new java.lang.String[] { + "TagKey", "UpdateMask", "ValidateOnly", + }); + internal_static_google_cloud_resourcemanager_v3_UpdateTagKeyMetadata_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_resourcemanager_v3_UpdateTagKeyMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_UpdateTagKeyMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_resourcemanager_v3_DeleteTagKeyRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_resourcemanager_v3_DeleteTagKeyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_DeleteTagKeyRequest_descriptor, + new java.lang.String[] { + "Name", "ValidateOnly", "Etag", + }); + internal_static_google_cloud_resourcemanager_v3_DeleteTagKeyMetadata_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_resourcemanager_v3_DeleteTagKeyMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_DeleteTagKeyMetadata_descriptor, + new java.lang.String[] {}); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.iam.v1.IamPolicyProto.getDescriptor(); + com.google.iam.v1.PolicyProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagValue.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagValue.java new file mode 100644 index 000000000000..c7b7702be621 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagValue.java @@ -0,0 +1,2194 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_values.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * A TagValue is a child of a particular TagKey. This is used to group
+ * cloud resources for the purpose of controlling them using policies.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.TagValue} + */ +public final class TagValue extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.TagValue) + TagValueOrBuilder { + private static final long serialVersionUID = 0L; + // Use TagValue.newBuilder() to construct. + private TagValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TagValue() { + name_ = ""; + parent_ = ""; + shortName_ = ""; + namespacedName_ = ""; + description_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TagValue(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TagValue( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + shortName_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + namespacedName_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 50: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 58: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + etag_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_TagValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_TagValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.TagValue.class, + com.google.cloud.resourcemanager.v3.TagValue.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Immutable. Resource name for TagValue in the format `tagValues/456`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. Resource name for TagValue in the format `tagValues/456`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARENT_FIELD_NUMBER = 2; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Immutable. The resource name of the new TagValue's parent TagKey.
+   * Must be of the form `tagKeys/{tag_key_id}`.
+   * 
+ * + * string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. The resource name of the new TagValue's parent TagKey.
+   * Must be of the form `tagKeys/{tag_key_id}`.
+   * 
+ * + * string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SHORT_NAME_FIELD_NUMBER = 3; + private volatile java.lang.Object shortName_; + /** + * + * + *
+   * 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.
+   * 
+ * + * + * string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The shortName. + */ + @java.lang.Override + public java.lang.String getShortName() { + java.lang.Object ref = shortName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + shortName_ = s; + return s; + } + } + /** + * + * + *
+   * 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.
+   * 
+ * + * + * string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for shortName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getShortNameBytes() { + java.lang.Object ref = shortName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + shortName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAMESPACED_NAME_FIELD_NUMBER = 4; + private volatile java.lang.Object namespacedName_; + /** + * + * + *
+   * Output only. Namespaced name of the TagValue. Must be in the format
+   * `{organization_id}/{tag_key_short_name}/{short_name}`.
+   * 
+ * + * string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The namespacedName. + */ + @java.lang.Override + public java.lang.String getNamespacedName() { + java.lang.Object ref = namespacedName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + namespacedName_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Namespaced name of the TagValue. Must be in the format
+   * `{organization_id}/{tag_key_short_name}/{short_name}`.
+   * 
+ * + * string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for namespacedName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNamespacedNameBytes() { + java.lang.Object ref = namespacedName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + namespacedName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 5; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Optional. User-assigned description of the TagValue.
+   * Must not exceed 256 characters.
+   * Read-write.
+   * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. User-assigned description of the TagValue.
+   * Must not exceed 256 characters.
+   * Read-write.
+   * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Update time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Update time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Update time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int ETAG_FIELD_NUMBER = 8; + private volatile java.lang.Object etag_; + /** + * + * + *
+   * Optional. Entity tag which users can pass to prevent race conditions. This field is
+   * always set in server responses. See UpdateTagValueRequest for details.
+   * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Entity tag which users can pass to prevent race conditions. This field is
+   * always set in server responses. See UpdateTagValueRequest for details.
+   * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, parent_); + } + if (!getShortNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, shortName_); + } + if (!getNamespacedNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, namespacedName_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, description_); + } + if (createTime_ != null) { + output.writeMessage(6, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(7, getUpdateTime()); + } + if (!getEtagBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, etag_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, parent_); + } + if (!getShortNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, shortName_); + } + if (!getNamespacedNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, namespacedName_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, description_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getUpdateTime()); + } + if (!getEtagBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, etag_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.TagValue)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.TagValue other = + (com.google.cloud.resourcemanager.v3.TagValue) obj; + + if (!getName().equals(other.getName())) return false; + if (!getParent().equals(other.getParent())) return false; + if (!getShortName().equals(other.getShortName())) return false; + if (!getNamespacedName().equals(other.getNamespacedName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!getEtag().equals(other.getEtag())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + SHORT_NAME_FIELD_NUMBER; + hash = (53 * hash) + getShortName().hashCode(); + hash = (37 * hash) + NAMESPACED_NAME_FIELD_NUMBER; + hash = (53 * hash) + getNamespacedName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.TagValue parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.TagValue parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.TagValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.TagValue parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.TagValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.TagValue parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.TagValue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.TagValue parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.TagValue parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.TagValue parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.TagValue parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.TagValue parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.resourcemanager.v3.TagValue prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A TagValue is a child of a particular TagKey. This is used to group
+   * cloud resources for the purpose of controlling them using policies.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.TagValue} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.TagValue) + com.google.cloud.resourcemanager.v3.TagValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_TagValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_TagValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.TagValue.class, + com.google.cloud.resourcemanager.v3.TagValue.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.TagValue.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + parent_ = ""; + + shortName_ = ""; + + namespacedName_ = ""; + + description_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + etag_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_TagValue_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagValue getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.TagValue.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagValue build() { + com.google.cloud.resourcemanager.v3.TagValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagValue buildPartial() { + com.google.cloud.resourcemanager.v3.TagValue result = + new com.google.cloud.resourcemanager.v3.TagValue(this); + result.name_ = name_; + result.parent_ = parent_; + result.shortName_ = shortName_; + result.namespacedName_ = namespacedName_; + result.description_ = description_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.etag_ = etag_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.TagValue) { + return mergeFrom((com.google.cloud.resourcemanager.v3.TagValue) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.TagValue other) { + if (other == com.google.cloud.resourcemanager.v3.TagValue.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getShortName().isEmpty()) { + shortName_ = other.shortName_; + onChanged(); + } + if (!other.getNamespacedName().isEmpty()) { + namespacedName_ = other.namespacedName_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.TagValue parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.resourcemanager.v3.TagValue) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. Resource name for TagValue in the format `tagValues/456`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. Resource name for TagValue in the format `tagValues/456`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. Resource name for TagValue in the format `tagValues/456`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Resource name for TagValue in the format `tagValues/456`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Resource name for TagValue in the format `tagValues/456`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Immutable. The resource name of the new TagValue's parent TagKey.
+     * Must be of the form `tagKeys/{tag_key_id}`.
+     * 
+ * + * string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. The resource name of the new TagValue's parent TagKey.
+     * Must be of the form `tagKeys/{tag_key_id}`.
+     * 
+ * + * string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. The resource name of the new TagValue's parent TagKey.
+     * Must be of the form `tagKeys/{tag_key_id}`.
+     * 
+ * + * string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The resource name of the new TagValue's parent TagKey.
+     * Must be of the form `tagKeys/{tag_key_id}`.
+     * 
+ * + * string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The resource name of the new TagValue's parent TagKey.
+     * Must be of the form `tagKeys/{tag_key_id}`.
+     * 
+ * + * string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object shortName_ = ""; + /** + * + * + *
+     * 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.
+     * 
+ * + * + * string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The shortName. + */ + public java.lang.String getShortName() { + java.lang.Object ref = shortName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + shortName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for shortName. + */ + public com.google.protobuf.ByteString getShortNameBytes() { + java.lang.Object ref = shortName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + shortName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * + * string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The shortName to set. + * @return This builder for chaining. + */ + public Builder setShortName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + shortName_ = value; + onChanged(); + 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.
+     * 
+ * + * + * string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearShortName() { + + shortName_ = getDefaultInstance().getShortName(); + onChanged(); + 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.
+     * 
+ * + * + * string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for shortName to set. + * @return This builder for chaining. + */ + public Builder setShortNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + shortName_ = value; + onChanged(); + return this; + } + + private java.lang.Object namespacedName_ = ""; + /** + * + * + *
+     * Output only. Namespaced name of the TagValue. Must be in the format
+     * `{organization_id}/{tag_key_short_name}/{short_name}`.
+     * 
+ * + * string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The namespacedName. + */ + public java.lang.String getNamespacedName() { + java.lang.Object ref = namespacedName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + namespacedName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Namespaced name of the TagValue. Must be in the format
+     * `{organization_id}/{tag_key_short_name}/{short_name}`.
+     * 
+ * + * string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for namespacedName. + */ + public com.google.protobuf.ByteString getNamespacedNameBytes() { + java.lang.Object ref = namespacedName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + namespacedName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Namespaced name of the TagValue. Must be in the format
+     * `{organization_id}/{tag_key_short_name}/{short_name}`.
+     * 
+ * + * string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The namespacedName to set. + * @return This builder for chaining. + */ + public Builder setNamespacedName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + namespacedName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Namespaced name of the TagValue. Must be in the format
+     * `{organization_id}/{tag_key_short_name}/{short_name}`.
+     * 
+ * + * string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearNamespacedName() { + + namespacedName_ = getDefaultInstance().getNamespacedName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Namespaced name of the TagValue. Must be in the format
+     * `{organization_id}/{tag_key_short_name}/{short_name}`.
+     * 
+ * + * string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for namespacedName to set. + * @return This builder for chaining. + */ + public Builder setNamespacedNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + namespacedName_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Optional. User-assigned description of the TagValue.
+     * Must not exceed 256 characters.
+     * Read-write.
+     * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. User-assigned description of the TagValue.
+     * Must not exceed 256 characters.
+     * Read-write.
+     * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. User-assigned description of the TagValue.
+     * Must not exceed 256 characters.
+     * Read-write.
+     * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. User-assigned description of the TagValue.
+     * Must not exceed 256 characters.
+     * Read-write.
+     * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. User-assigned description of the TagValue.
+     * Must not exceed 256 characters.
+     * Read-write.
+     * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Creation time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Update time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. Update time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Update time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Update time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Update time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Update time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Update time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Update time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Update time.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. Entity tag which users can pass to prevent race conditions. This field is
+     * always set in server responses. See UpdateTagValueRequest for details.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Entity tag which users can pass to prevent race conditions. This field is
+     * always set in server responses. See UpdateTagValueRequest for details.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Entity tag which users can pass to prevent race conditions. This field is
+     * always set in server responses. See UpdateTagValueRequest for details.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + etag_ = value; + onChanged(); + 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.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + + etag_ = getDefaultInstance().getEtag(); + onChanged(); + 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.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + etag_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.TagValue) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.TagValue) + private static final com.google.cloud.resourcemanager.v3.TagValue DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.TagValue(); + } + + public static com.google.cloud.resourcemanager.v3.TagValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TagValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TagValue(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagValueName.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagValueName.java new file mode 100644 index 000000000000..d6a39021a109 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagValueName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.resourcemanager.v3; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class TagValueName implements ResourceName { + private static final PathTemplate TAG_VALUE = + PathTemplate.createWithoutUrlEncoding("tagValues/{tag_value}"); + private volatile Map fieldValuesMap; + private final String tagValue; + + @Deprecated + protected TagValueName() { + tagValue = null; + } + + private TagValueName(Builder builder) { + tagValue = Preconditions.checkNotNull(builder.getTagValue()); + } + + public String getTagValue() { + return tagValue; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static TagValueName of(String tagValue) { + return newBuilder().setTagValue(tagValue).build(); + } + + public static String format(String tagValue) { + return newBuilder().setTagValue(tagValue).build().toString(); + } + + public static TagValueName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + TAG_VALUE.validatedMatch( + formattedString, "TagValueName.parse: formattedString not in valid format"); + return of(matchMap.get("tag_value")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (TagValueName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return TAG_VALUE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (tagValue != null) { + fieldMapBuilder.put("tag_value", tagValue); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return TAG_VALUE.instantiate("tag_value", tagValue); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + TagValueName that = ((TagValueName) o); + return Objects.equals(this.tagValue, that.tagValue); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(tagValue); + return h; + } + + /** Builder for tagValues/{tag_value}. */ + public static class Builder { + private String tagValue; + + protected Builder() {} + + public String getTagValue() { + return tagValue; + } + + public Builder setTagValue(String tagValue) { + this.tagValue = tagValue; + return this; + } + + private Builder(TagValueName tagValueName) { + tagValue = tagValueName.tagValue; + } + + public TagValueName build() { + return new TagValueName(this); + } + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagValueOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagValueOrBuilder.java new file mode 100644 index 000000000000..e16b06b17bc6 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagValueOrBuilder.java @@ -0,0 +1,273 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_values.proto + +package com.google.cloud.resourcemanager.v3; + +public interface TagValueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.TagValue) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. Resource name for TagValue in the format `tagValues/456`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Immutable. Resource name for TagValue in the format `tagValues/456`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Immutable. The resource name of the new TagValue's parent TagKey.
+   * Must be of the form `tagKeys/{tag_key_id}`.
+   * 
+ * + * string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Immutable. The resource name of the new TagValue's parent TagKey.
+   * Must be of the form `tagKeys/{tag_key_id}`.
+   * 
+ * + * string parent = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * + * string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The shortName. + */ + java.lang.String getShortName(); + /** + * + * + *
+   * 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.
+   * 
+ * + * + * string short_name = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for shortName. + */ + com.google.protobuf.ByteString getShortNameBytes(); + + /** + * + * + *
+   * Output only. Namespaced name of the TagValue. Must be in the format
+   * `{organization_id}/{tag_key_short_name}/{short_name}`.
+   * 
+ * + * string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The namespacedName. + */ + java.lang.String getNamespacedName(); + /** + * + * + *
+   * Output only. Namespaced name of the TagValue. Must be in the format
+   * `{organization_id}/{tag_key_short_name}/{short_name}`.
+   * 
+ * + * string namespaced_name = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for namespacedName. + */ + com.google.protobuf.ByteString getNamespacedNameBytes(); + + /** + * + * + *
+   * Optional. User-assigned description of the TagValue.
+   * Must not exceed 256 characters.
+   * Read-write.
+   * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Optional. User-assigned description of the TagValue.
+   * Must not exceed 256 characters.
+   * Read-write.
+   * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. Creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Creation time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Update time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Update time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Update time.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Optional. Entity tag which users can pass to prevent race conditions. This field is
+   * always set in server responses. See UpdateTagValueRequest for details.
+   * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. Entity tag which users can pass to prevent race conditions. This field is
+   * always set in server responses. See UpdateTagValueRequest for details.
+   * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagValuesProto.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagValuesProto.java new file mode 100644 index 000000000000..3c56d5e5668a --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/TagValuesProto.java @@ -0,0 +1,281 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_values.proto + +package com.google.cloud.resourcemanager.v3; + +public final class TagValuesProto { + private TagValuesProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_TagValue_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_TagValue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_ListTagValuesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_ListTagValuesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_ListTagValuesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_ListTagValuesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_GetTagValueRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_GetTagValueRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_CreateTagValueRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_CreateTagValueRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_CreateTagValueMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_CreateTagValueMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_UpdateTagValueRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_UpdateTagValueRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_UpdateTagValueMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_UpdateTagValueMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_DeleteTagValueRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_DeleteTagValueRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_resourcemanager_v3_DeleteTagValueMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_resourcemanager_v3_DeleteTagValueMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n0google/cloud/resourcemanager/v3/tag_va" + + "lues.proto\022\037google.cloud.resourcemanager" + + ".v3\032\034google/api/annotations.proto\032\027googl" + + "e/api/client.proto\032\037google/api/field_beh" + + "avior.proto\032\031google/api/resource.proto\032\036" + + "google/iam/v1/iam_policy.proto\032\032google/i" + + "am/v1/policy.proto\032#google/longrunning/o" + + "perations.proto\032 google/protobuf/field_m" + + "ask.proto\032\037google/protobuf/timestamp.pro" + + "to\"\322\002\n\010TagValue\022\021\n\004name\030\001 \001(\tB\003\340A\005\022\023\n\006pa" + + "rent\030\002 \001(\tB\003\340A\005\022\032\n\nshort_name\030\003 \001(\tB\006\340A\002" + + "\340A\005\022\034\n\017namespaced_name\030\004 \001(\tB\003\340A\003\022\030\n\013des" + + "cription\030\005 \001(\tB\003\340A\001\0224\n\013create_time\030\006 \001(\013" + + "2\032.google.protobuf.TimestampB\003\340A\003\0224\n\013upd" + + "ate_time\030\007 \001(\0132\032.google.protobuf.Timesta" + + "mpB\003\340A\003\022\021\n\004etag\030\010 \001(\tB\003\340A\001:K\352AH\n,cloudre" + + "sourcemanager.googleapis.com/TagValue\022\025t" + + "agValues/{tag_value}R\001\001\"b\n\024ListTagValues" + + "Request\022\031\n\006parent\030\001 \001(\tB\t\340A\002\372A\003\022\001*\022\026\n\tpa" + + "ge_size\030\002 \001(\005B\003\340A\001\022\027\n\npage_token\030\003 \001(\tB\003" + + "\340A\001\"o\n\025ListTagValuesResponse\022=\n\ntag_valu" + + "es\030\001 \003(\0132).google.cloud.resourcemanager." + + "v3.TagValue\022\027\n\017next_page_token\030\002 \001(\t\"X\n\022" + + "GetTagValueRequest\022B\n\004name\030\001 \001(\tB4\340A\002\372A." + + "\n,cloudresourcemanager.googleapis.com/Ta" + + "gValue\"v\n\025CreateTagValueRequest\022A\n\ttag_v" + + "alue\030\001 \001(\0132).google.cloud.resourcemanage" + + "r.v3.TagValueB\003\340A\002\022\032\n\rvalidate_only\030\002 \001(" + + "\010B\003\340A\001\"\030\n\026CreateTagValueMetadata\"\254\001\n\025Upd" + + "ateTagValueRequest\022A\n\ttag_value\030\001 \001(\0132)." + + "google.cloud.resourcemanager.v3.TagValue" + + "B\003\340A\002\0224\n\013update_mask\030\002 \001(\0132\032.google.prot" + + "obuf.FieldMaskB\003\340A\001\022\032\n\rvalidate_only\030\003 \001" + + "(\010B\003\340A\001\"\030\n\026UpdateTagValueMetadata\"\212\001\n\025De" + + "leteTagValueRequest\022B\n\004name\030\001 \001(\tB4\340A\002\372A" + + ".\n,cloudresourcemanager.googleapis.com/T" + + "agValue\022\032\n\rvalidate_only\030\002 \001(\010B\003\340A\001\022\021\n\004e" + + "tag\030\003 \001(\tB\003\340A\001\"\030\n\026DeleteTagValueMetadata" + + "2\377\013\n\tTagValues\022\236\001\n\rListTagValues\0225.googl" + + "e.cloud.resourcemanager.v3.ListTagValues" + + "Request\0326.google.cloud.resourcemanager.v" + + "3.ListTagValuesResponse\"\036\202\323\344\223\002\017\022\r/v3/tag" + + "Values\332A\006parent\022\224\001\n\013GetTagValue\0223.google" + + ".cloud.resourcemanager.v3.GetTagValueReq" + + "uest\032).google.cloud.resourcemanager.v3.T" + + "agValue\"%\202\323\344\223\002\030\022\026/v3/{name=tagValues/*}\332" + + "A\004name\022\272\001\n\016CreateTagValue\0226.google.cloud" + + ".resourcemanager.v3.CreateTagValueReques" + + "t\032\035.google.longrunning.Operation\"Q\202\323\344\223\002\032" + + "\"\r/v3/tagValues:\ttag_value\332A\ttag_value\312A" + + "\"\n\010TagValue\022\026CreateTagValueMetadata\022\331\001\n\016" + + "UpdateTagValue\0226.google.cloud.resourcema" + + "nager.v3.UpdateTagValueRequest\032\035.google." + + "longrunning.Operation\"p\202\323\344\223\002-2 /v3/{tag_" + + "value.name=tagValues/*}:\ttag_value\332A\025tag" + + "_value,update_mask\312A\"\n\010TagValue\022\026UpdateT" + + "agValueMetadata\022\263\001\n\016DeleteTagValue\0226.goo" + + "gle.cloud.resourcemanager.v3.DeleteTagVa" + + "lueRequest\032\035.google.longrunning.Operatio" + + "n\"J\202\323\344\223\002\030*\026/v3/{name=tagValues/*}\332A\004name" + + "\312A\"\n\010TagValue\022\026DeleteTagValueMetadata\022\210\001" + + "\n\014GetIamPolicy\022\".google.iam.v1.GetIamPol" + + "icyRequest\032\025.google.iam.v1.Policy\"=\202\323\344\223\002" + + ",\"\'/v3/{resource=tagValues/*}:getIamPoli" + + "cy:\001*\332A\010resource\022\217\001\n\014SetIamPolicy\022\".goog" + + "le.iam.v1.SetIamPolicyRequest\032\025.google.i" + + "am.v1.Policy\"D\202\323\344\223\002,\"\'/v3/{resource=tagV" + + "alues/*}:setIamPolicy:\001*\332A\017resource,poli" + + "cy\022\272\001\n\022TestIamPermissions\022(.google.iam.v" + + "1.TestIamPermissionsRequest\032).google.iam" + + ".v1.TestIamPermissionsResponse\"O\202\323\344\223\0022\"-" + + "/v3/{resource=tagValues/*}:testIamPermis" + + "sions:\001*\332A\024resource,permissions\032\220\001\312A#clo" + + "udresourcemanager.googleapis.com\322Aghttps" + + "://www.googleapis.com/auth/cloud-platfor" + + "m,https://www.googleapis.com/auth/cloud-" + + "platform.read-onlyB\313\001\n#com.google.cloud." + + "resourcemanager.v3B\016TagValuesProtoP\001ZNgo" + + "ogle.golang.org/genproto/googleapis/clou" + + "d/resourcemanager/v3;resourcemanager\252\002\037G" + + "oogle.Cloud.ResourceManager.V3\312\002\037Google\\" + + "Cloud\\ResourceManager\\V3b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.iam.v1.IamPolicyProto.getDescriptor(), + com.google.iam.v1.PolicyProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_resourcemanager_v3_TagValue_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_resourcemanager_v3_TagValue_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_TagValue_descriptor, + new java.lang.String[] { + "Name", + "Parent", + "ShortName", + "NamespacedName", + "Description", + "CreateTime", + "UpdateTime", + "Etag", + }); + internal_static_google_cloud_resourcemanager_v3_ListTagValuesRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_resourcemanager_v3_ListTagValuesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_ListTagValuesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_resourcemanager_v3_ListTagValuesResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_resourcemanager_v3_ListTagValuesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_ListTagValuesResponse_descriptor, + new java.lang.String[] { + "TagValues", "NextPageToken", + }); + internal_static_google_cloud_resourcemanager_v3_GetTagValueRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_resourcemanager_v3_GetTagValueRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_GetTagValueRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_resourcemanager_v3_CreateTagValueRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_resourcemanager_v3_CreateTagValueRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_CreateTagValueRequest_descriptor, + new java.lang.String[] { + "TagValue", "ValidateOnly", + }); + internal_static_google_cloud_resourcemanager_v3_CreateTagValueMetadata_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_resourcemanager_v3_CreateTagValueMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_CreateTagValueMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_resourcemanager_v3_UpdateTagValueRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_resourcemanager_v3_UpdateTagValueRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_UpdateTagValueRequest_descriptor, + new java.lang.String[] { + "TagValue", "UpdateMask", "ValidateOnly", + }); + internal_static_google_cloud_resourcemanager_v3_UpdateTagValueMetadata_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_resourcemanager_v3_UpdateTagValueMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_UpdateTagValueMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_resourcemanager_v3_DeleteTagValueRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_resourcemanager_v3_DeleteTagValueRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_DeleteTagValueRequest_descriptor, + new java.lang.String[] { + "Name", "ValidateOnly", "Etag", + }); + internal_static_google_cloud_resourcemanager_v3_DeleteTagValueMetadata_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_resourcemanager_v3_DeleteTagValueMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_resourcemanager_v3_DeleteTagValueMetadata_descriptor, + new java.lang.String[] {}); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.iam.v1.IamPolicyProto.getDescriptor(); + com.google.iam.v1.PolicyProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteFolderMetadata.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteFolderMetadata.java new file mode 100644 index 000000000000..1a7f54de933d --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteFolderMetadata.java @@ -0,0 +1,459 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * A status object which is used as the `metadata` field for the `Operation`
+ * returned by `UndeleteFolder`.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UndeleteFolderMetadata} + */ +public final class UndeleteFolderMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.UndeleteFolderMetadata) + UndeleteFolderMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use UndeleteFolderMetadata.newBuilder() to construct. + private UndeleteFolderMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UndeleteFolderMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UndeleteFolderMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UndeleteFolderMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_UndeleteFolderMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_UndeleteFolderMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata.class, + com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata other = + (com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A status object which is used as the `metadata` field for the `Operation`
+   * returned by `UndeleteFolder`.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UndeleteFolderMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.UndeleteFolderMetadata) + com.google.cloud.resourcemanager.v3.UndeleteFolderMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_UndeleteFolderMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_UndeleteFolderMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata.class, + com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_UndeleteFolderMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata build() { + com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata buildPartial() { + com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata result = + new com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata) { + return mergeFrom((com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata other) { + if (other == com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.UndeleteFolderMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.UndeleteFolderMetadata) + private static final com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata(); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UndeleteFolderMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UndeleteFolderMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UndeleteFolderMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteFolderMetadataOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteFolderMetadataOrBuilder.java new file mode 100644 index 000000000000..bcea1ba852ac --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteFolderMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +public interface UndeleteFolderMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.UndeleteFolderMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteFolderRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteFolderRequest.java new file mode 100644 index 000000000000..860cdafe2d6e --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteFolderRequest.java @@ -0,0 +1,658 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The UndeleteFolder request message.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UndeleteFolderRequest} + */ +public final class UndeleteFolderRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.UndeleteFolderRequest) + UndeleteFolderRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UndeleteFolderRequest.newBuilder() to construct. + private UndeleteFolderRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UndeleteFolderRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UndeleteFolderRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UndeleteFolderRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_UndeleteFolderRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_UndeleteFolderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UndeleteFolderRequest.class, + com.google.cloud.resourcemanager.v3.UndeleteFolderRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the folder to undelete.
+   * Must be of the form `folders/{folder_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the folder to undelete.
+   * Must be of the form `folders/{folder_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.UndeleteFolderRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.UndeleteFolderRequest other = + (com.google.cloud.resourcemanager.v3.UndeleteFolderRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.UndeleteFolderRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The UndeleteFolder request message.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UndeleteFolderRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.UndeleteFolderRequest) + com.google.cloud.resourcemanager.v3.UndeleteFolderRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_UndeleteFolderRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_UndeleteFolderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UndeleteFolderRequest.class, + com.google.cloud.resourcemanager.v3.UndeleteFolderRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.UndeleteFolderRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_UndeleteFolderRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UndeleteFolderRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.UndeleteFolderRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UndeleteFolderRequest build() { + com.google.cloud.resourcemanager.v3.UndeleteFolderRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UndeleteFolderRequest buildPartial() { + com.google.cloud.resourcemanager.v3.UndeleteFolderRequest result = + new com.google.cloud.resourcemanager.v3.UndeleteFolderRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.UndeleteFolderRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.UndeleteFolderRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.UndeleteFolderRequest other) { + if (other == com.google.cloud.resourcemanager.v3.UndeleteFolderRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.UndeleteFolderRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.UndeleteFolderRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the folder to undelete.
+     * Must be of the form `folders/{folder_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the folder to undelete.
+     * Must be of the form `folders/{folder_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the folder to undelete.
+     * Must be of the form `folders/{folder_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the folder to undelete.
+     * Must be of the form `folders/{folder_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the folder to undelete.
+     * Must be of the form `folders/{folder_id}`.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.UndeleteFolderRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.UndeleteFolderRequest) + private static final com.google.cloud.resourcemanager.v3.UndeleteFolderRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.UndeleteFolderRequest(); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteFolderRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UndeleteFolderRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UndeleteFolderRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UndeleteFolderRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteFolderRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteFolderRequestOrBuilder.java new file mode 100644 index 000000000000..b44659824c31 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteFolderRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +public interface UndeleteFolderRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.UndeleteFolderRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the folder to undelete.
+   * Must be of the form `folders/{folder_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the folder to undelete.
+   * Must be of the form `folders/{folder_id}`.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteOrganizationMetadata.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteOrganizationMetadata.java new file mode 100644 index 000000000000..7e0713023dad --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteOrganizationMetadata.java @@ -0,0 +1,466 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/organizations.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * A status object which is used as the `metadata` field for the Operation
+ * returned by UndeleteOrganization.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata} + */ +public final class UndeleteOrganizationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata) + UndeleteOrganizationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use UndeleteOrganizationMetadata.newBuilder() to construct. + private UndeleteOrganizationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UndeleteOrganizationMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UndeleteOrganizationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UndeleteOrganizationMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_UndeleteOrganizationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_UndeleteOrganizationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata.class, + com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata other = + (com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A status object which is used as the `metadata` field for the Operation
+   * returned by UndeleteOrganization.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata) + com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_UndeleteOrganizationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_UndeleteOrganizationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata.class, + com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.OrganizationsProto + .internal_static_google_cloud_resourcemanager_v3_UndeleteOrganizationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata + getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata build() { + com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata buildPartial() { + com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata result = + new com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata) { + return mergeFrom((com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata other) { + if (other + == com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata) + private static final com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata(); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UndeleteOrganizationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UndeleteOrganizationMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteOrganizationMetadataOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteOrganizationMetadataOrBuilder.java new file mode 100644 index 000000000000..30cef677c834 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteOrganizationMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/organizations.proto + +package com.google.cloud.resourcemanager.v3; + +public interface UndeleteOrganizationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteProjectMetadata.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteProjectMetadata.java new file mode 100644 index 000000000000..9579a1dfdf80 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteProjectMetadata.java @@ -0,0 +1,459 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * A status object which is used as the `metadata` field for the Operation
+ * returned by `UndeleteProject`.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UndeleteProjectMetadata} + */ +public final class UndeleteProjectMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.UndeleteProjectMetadata) + UndeleteProjectMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use UndeleteProjectMetadata.newBuilder() to construct. + private UndeleteProjectMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UndeleteProjectMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UndeleteProjectMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UndeleteProjectMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_UndeleteProjectMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_UndeleteProjectMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata.class, + com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata other = + (com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A status object which is used as the `metadata` field for the Operation
+   * returned by `UndeleteProject`.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UndeleteProjectMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.UndeleteProjectMetadata) + com.google.cloud.resourcemanager.v3.UndeleteProjectMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_UndeleteProjectMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_UndeleteProjectMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata.class, + com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_UndeleteProjectMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata build() { + com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata buildPartial() { + com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata result = + new com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata) { + return mergeFrom((com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata other) { + if (other == com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.UndeleteProjectMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.UndeleteProjectMetadata) + private static final com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata(); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UndeleteProjectMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UndeleteProjectMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UndeleteProjectMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteProjectMetadataOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteProjectMetadataOrBuilder.java new file mode 100644 index 000000000000..c822c30d73da --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteProjectMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +public interface UndeleteProjectMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.UndeleteProjectMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteProjectRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteProjectRequest.java new file mode 100644 index 000000000000..7a2315c063f1 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteProjectRequest.java @@ -0,0 +1,662 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The request sent to the [UndeleteProject]
+ * [google.cloud.resourcemanager.v3.Projects.UndeleteProject]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UndeleteProjectRequest} + */ +public final class UndeleteProjectRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.UndeleteProjectRequest) + UndeleteProjectRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UndeleteProjectRequest.newBuilder() to construct. + private UndeleteProjectRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UndeleteProjectRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UndeleteProjectRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UndeleteProjectRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_UndeleteProjectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_UndeleteProjectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UndeleteProjectRequest.class, + com.google.cloud.resourcemanager.v3.UndeleteProjectRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the project (for example, `projects/415104041262`).
+   * Required.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the project (for example, `projects/415104041262`).
+   * Required.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.UndeleteProjectRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.UndeleteProjectRequest other = + (com.google.cloud.resourcemanager.v3.UndeleteProjectRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.UndeleteProjectRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request sent to the [UndeleteProject]
+   * [google.cloud.resourcemanager.v3.Projects.UndeleteProject]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UndeleteProjectRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.UndeleteProjectRequest) + com.google.cloud.resourcemanager.v3.UndeleteProjectRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_UndeleteProjectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_UndeleteProjectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UndeleteProjectRequest.class, + com.google.cloud.resourcemanager.v3.UndeleteProjectRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.UndeleteProjectRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_UndeleteProjectRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UndeleteProjectRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.UndeleteProjectRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UndeleteProjectRequest build() { + com.google.cloud.resourcemanager.v3.UndeleteProjectRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UndeleteProjectRequest buildPartial() { + com.google.cloud.resourcemanager.v3.UndeleteProjectRequest result = + new com.google.cloud.resourcemanager.v3.UndeleteProjectRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.UndeleteProjectRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.UndeleteProjectRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.UndeleteProjectRequest other) { + if (other == com.google.cloud.resourcemanager.v3.UndeleteProjectRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.UndeleteProjectRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.UndeleteProjectRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the project (for example, `projects/415104041262`).
+     * Required.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the project (for example, `projects/415104041262`).
+     * Required.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the project (for example, `projects/415104041262`).
+     * Required.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the project (for example, `projects/415104041262`).
+     * Required.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the project (for example, `projects/415104041262`).
+     * Required.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.UndeleteProjectRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.UndeleteProjectRequest) + private static final com.google.cloud.resourcemanager.v3.UndeleteProjectRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.UndeleteProjectRequest(); + } + + public static com.google.cloud.resourcemanager.v3.UndeleteProjectRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UndeleteProjectRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UndeleteProjectRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UndeleteProjectRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteProjectRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteProjectRequestOrBuilder.java new file mode 100644 index 000000000000..4907d0d1d4ce --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UndeleteProjectRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +public interface UndeleteProjectRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.UndeleteProjectRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the project (for example, `projects/415104041262`).
+   * Required.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the project (for example, `projects/415104041262`).
+   * Required.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateFolderMetadata.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateFolderMetadata.java new file mode 100644 index 000000000000..c3ffcc6ec658 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateFolderMetadata.java @@ -0,0 +1,459 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * A status object which is used as the `metadata` field for the Operation
+ * returned by UpdateFolder.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UpdateFolderMetadata} + */ +public final class UpdateFolderMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.UpdateFolderMetadata) + UpdateFolderMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateFolderMetadata.newBuilder() to construct. + private UpdateFolderMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateFolderMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateFolderMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateFolderMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_UpdateFolderMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_UpdateFolderMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UpdateFolderMetadata.class, + com.google.cloud.resourcemanager.v3.UpdateFolderMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.UpdateFolderMetadata)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.UpdateFolderMetadata other = + (com.google.cloud.resourcemanager.v3.UpdateFolderMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.UpdateFolderMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A status object which is used as the `metadata` field for the Operation
+   * returned by UpdateFolder.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UpdateFolderMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.UpdateFolderMetadata) + com.google.cloud.resourcemanager.v3.UpdateFolderMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_UpdateFolderMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_UpdateFolderMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UpdateFolderMetadata.class, + com.google.cloud.resourcemanager.v3.UpdateFolderMetadata.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.UpdateFolderMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_UpdateFolderMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateFolderMetadata getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.UpdateFolderMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateFolderMetadata build() { + com.google.cloud.resourcemanager.v3.UpdateFolderMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateFolderMetadata buildPartial() { + com.google.cloud.resourcemanager.v3.UpdateFolderMetadata result = + new com.google.cloud.resourcemanager.v3.UpdateFolderMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.UpdateFolderMetadata) { + return mergeFrom((com.google.cloud.resourcemanager.v3.UpdateFolderMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.UpdateFolderMetadata other) { + if (other == com.google.cloud.resourcemanager.v3.UpdateFolderMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.UpdateFolderMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.UpdateFolderMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.UpdateFolderMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.UpdateFolderMetadata) + private static final com.google.cloud.resourcemanager.v3.UpdateFolderMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.UpdateFolderMetadata(); + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateFolderMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateFolderMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateFolderMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateFolderMetadataOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateFolderMetadataOrBuilder.java new file mode 100644 index 000000000000..7bce81407163 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateFolderMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +public interface UpdateFolderMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.UpdateFolderMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateFolderRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateFolderRequest.java new file mode 100644 index 000000000000..c5288e5c9163 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateFolderRequest.java @@ -0,0 +1,1078 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The request sent to the
+ * [UpdateFolder][google.cloud.resourcemanager.v3.Folder.UpdateFolder]
+ * method.
+ * Only the `display_name` field can be changed. All other fields will be
+ * ignored. Use the
+ * [MoveFolder][google.cloud.resourcemanager.v3.Folders.MoveFolder] method to
+ * change the `parent` field.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UpdateFolderRequest} + */ +public final class UpdateFolderRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.UpdateFolderRequest) + UpdateFolderRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateFolderRequest.newBuilder() to construct. + private UpdateFolderRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateFolderRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateFolderRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateFolderRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.resourcemanager.v3.Folder.Builder subBuilder = null; + if (folder_ != null) { + subBuilder = folder_.toBuilder(); + } + folder_ = + input.readMessage( + com.google.cloud.resourcemanager.v3.Folder.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(folder_); + folder_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_UpdateFolderRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_UpdateFolderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UpdateFolderRequest.class, + com.google.cloud.resourcemanager.v3.UpdateFolderRequest.Builder.class); + } + + public static final int FOLDER_FIELD_NUMBER = 1; + private com.google.cloud.resourcemanager.v3.Folder folder_; + /** + * + * + *
+   * Required. The new definition of the Folder. It must include the `name` field, which
+   * cannot be changed.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the folder field is set. + */ + @java.lang.Override + public boolean hasFolder() { + return folder_ != null; + } + /** + * + * + *
+   * Required. The new definition of the Folder. It must include the `name` field, which
+   * cannot be changed.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The folder. + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Folder getFolder() { + return folder_ == null + ? com.google.cloud.resourcemanager.v3.Folder.getDefaultInstance() + : folder_; + } + /** + * + * + *
+   * Required. The new definition of the Folder. It must include the `name` field, which
+   * cannot be changed.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.FolderOrBuilder getFolderOrBuilder() { + return getFolder(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. Fields to be updated.
+   * Only the `display_name` can be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. Fields to be updated.
+   * Only the `display_name` can be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. Fields to be updated.
+   * Only the `display_name` can be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (folder_ != null) { + output.writeMessage(1, getFolder()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (folder_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getFolder()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.UpdateFolderRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.UpdateFolderRequest other = + (com.google.cloud.resourcemanager.v3.UpdateFolderRequest) obj; + + if (hasFolder() != other.hasFolder()) return false; + if (hasFolder()) { + if (!getFolder().equals(other.getFolder())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasFolder()) { + hash = (37 * hash) + FOLDER_FIELD_NUMBER; + hash = (53 * hash) + getFolder().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.UpdateFolderRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request sent to the
+   * [UpdateFolder][google.cloud.resourcemanager.v3.Folder.UpdateFolder]
+   * method.
+   * Only the `display_name` field can be changed. All other fields will be
+   * ignored. Use the
+   * [MoveFolder][google.cloud.resourcemanager.v3.Folders.MoveFolder] method to
+   * change the `parent` field.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UpdateFolderRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.UpdateFolderRequest) + com.google.cloud.resourcemanager.v3.UpdateFolderRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_UpdateFolderRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_UpdateFolderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UpdateFolderRequest.class, + com.google.cloud.resourcemanager.v3.UpdateFolderRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.UpdateFolderRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (folderBuilder_ == null) { + folder_ = null; + } else { + folder_ = null; + folderBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.FoldersProto + .internal_static_google_cloud_resourcemanager_v3_UpdateFolderRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateFolderRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.UpdateFolderRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateFolderRequest build() { + com.google.cloud.resourcemanager.v3.UpdateFolderRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateFolderRequest buildPartial() { + com.google.cloud.resourcemanager.v3.UpdateFolderRequest result = + new com.google.cloud.resourcemanager.v3.UpdateFolderRequest(this); + if (folderBuilder_ == null) { + result.folder_ = folder_; + } else { + result.folder_ = folderBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.UpdateFolderRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.UpdateFolderRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.UpdateFolderRequest other) { + if (other == com.google.cloud.resourcemanager.v3.UpdateFolderRequest.getDefaultInstance()) + return this; + if (other.hasFolder()) { + mergeFolder(other.getFolder()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.UpdateFolderRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.UpdateFolderRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.resourcemanager.v3.Folder folder_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Folder, + com.google.cloud.resourcemanager.v3.Folder.Builder, + com.google.cloud.resourcemanager.v3.FolderOrBuilder> + folderBuilder_; + /** + * + * + *
+     * Required. The new definition of the Folder. It must include the `name` field, which
+     * cannot be changed.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the folder field is set. + */ + public boolean hasFolder() { + return folderBuilder_ != null || folder_ != null; + } + /** + * + * + *
+     * Required. The new definition of the Folder. It must include the `name` field, which
+     * cannot be changed.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The folder. + */ + public com.google.cloud.resourcemanager.v3.Folder getFolder() { + if (folderBuilder_ == null) { + return folder_ == null + ? com.google.cloud.resourcemanager.v3.Folder.getDefaultInstance() + : folder_; + } else { + return folderBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The new definition of the Folder. It must include the `name` field, which
+     * cannot be changed.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFolder(com.google.cloud.resourcemanager.v3.Folder value) { + if (folderBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + folder_ = value; + onChanged(); + } else { + folderBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The new definition of the Folder. It must include the `name` field, which
+     * cannot be changed.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFolder(com.google.cloud.resourcemanager.v3.Folder.Builder builderForValue) { + if (folderBuilder_ == null) { + folder_ = builderForValue.build(); + onChanged(); + } else { + folderBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The new definition of the Folder. It must include the `name` field, which
+     * cannot be changed.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeFolder(com.google.cloud.resourcemanager.v3.Folder value) { + if (folderBuilder_ == null) { + if (folder_ != null) { + folder_ = + com.google.cloud.resourcemanager.v3.Folder.newBuilder(folder_) + .mergeFrom(value) + .buildPartial(); + } else { + folder_ = value; + } + onChanged(); + } else { + folderBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The new definition of the Folder. It must include the `name` field, which
+     * cannot be changed.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearFolder() { + if (folderBuilder_ == null) { + folder_ = null; + onChanged(); + } else { + folder_ = null; + folderBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The new definition of the Folder. It must include the `name` field, which
+     * cannot be changed.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.resourcemanager.v3.Folder.Builder getFolderBuilder() { + + onChanged(); + return getFolderFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The new definition of the Folder. It must include the `name` field, which
+     * cannot be changed.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.resourcemanager.v3.FolderOrBuilder getFolderOrBuilder() { + if (folderBuilder_ != null) { + return folderBuilder_.getMessageOrBuilder(); + } else { + return folder_ == null + ? com.google.cloud.resourcemanager.v3.Folder.getDefaultInstance() + : folder_; + } + } + /** + * + * + *
+     * Required. The new definition of the Folder. It must include the `name` field, which
+     * cannot be changed.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Folder, + com.google.cloud.resourcemanager.v3.Folder.Builder, + com.google.cloud.resourcemanager.v3.FolderOrBuilder> + getFolderFieldBuilder() { + if (folderBuilder_ == null) { + folderBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Folder, + com.google.cloud.resourcemanager.v3.Folder.Builder, + com.google.cloud.resourcemanager.v3.FolderOrBuilder>( + getFolder(), getParentForChildren(), isClean()); + folder_ = null; + } + return folderBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. Fields to be updated.
+     * Only the `display_name` can be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required. Fields to be updated.
+     * Only the `display_name` can be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Fields to be updated.
+     * Only the `display_name` can be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Fields to be updated.
+     * Only the `display_name` can be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Fields to be updated.
+     * Only the `display_name` can be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Fields to be updated.
+     * Only the `display_name` can be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Fields to be updated.
+     * Only the `display_name` can be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Fields to be updated.
+     * Only the `display_name` can be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. Fields to be updated.
+     * Only the `display_name` can be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.UpdateFolderRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.UpdateFolderRequest) + private static final com.google.cloud.resourcemanager.v3.UpdateFolderRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.UpdateFolderRequest(); + } + + public static com.google.cloud.resourcemanager.v3.UpdateFolderRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateFolderRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateFolderRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateFolderRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateFolderRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateFolderRequestOrBuilder.java new file mode 100644 index 000000000000..7fd65be25824 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateFolderRequestOrBuilder.java @@ -0,0 +1,110 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/folders.proto + +package com.google.cloud.resourcemanager.v3; + +public interface UpdateFolderRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.UpdateFolderRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The new definition of the Folder. It must include the `name` field, which
+   * cannot be changed.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the folder field is set. + */ + boolean hasFolder(); + /** + * + * + *
+   * Required. The new definition of the Folder. It must include the `name` field, which
+   * cannot be changed.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The folder. + */ + com.google.cloud.resourcemanager.v3.Folder getFolder(); + /** + * + * + *
+   * Required. The new definition of the Folder. It must include the `name` field, which
+   * cannot be changed.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Folder folder = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.resourcemanager.v3.FolderOrBuilder getFolderOrBuilder(); + + /** + * + * + *
+   * Required. Fields to be updated.
+   * Only the `display_name` can be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. Fields to be updated.
+   * Only the `display_name` can be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. Fields to be updated.
+   * Only the `display_name` can be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateProjectMetadata.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateProjectMetadata.java new file mode 100644 index 000000000000..07f4f73d9112 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateProjectMetadata.java @@ -0,0 +1,459 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * A status object which is used as the `metadata` field for the Operation
+ * returned by UpdateProject.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UpdateProjectMetadata} + */ +public final class UpdateProjectMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.UpdateProjectMetadata) + UpdateProjectMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateProjectMetadata.newBuilder() to construct. + private UpdateProjectMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateProjectMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateProjectMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateProjectMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_UpdateProjectMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_UpdateProjectMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UpdateProjectMetadata.class, + com.google.cloud.resourcemanager.v3.UpdateProjectMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.UpdateProjectMetadata)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.UpdateProjectMetadata other = + (com.google.cloud.resourcemanager.v3.UpdateProjectMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.UpdateProjectMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A status object which is used as the `metadata` field for the Operation
+   * returned by UpdateProject.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UpdateProjectMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.UpdateProjectMetadata) + com.google.cloud.resourcemanager.v3.UpdateProjectMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_UpdateProjectMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_UpdateProjectMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UpdateProjectMetadata.class, + com.google.cloud.resourcemanager.v3.UpdateProjectMetadata.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.UpdateProjectMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_UpdateProjectMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateProjectMetadata getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.UpdateProjectMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateProjectMetadata build() { + com.google.cloud.resourcemanager.v3.UpdateProjectMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateProjectMetadata buildPartial() { + com.google.cloud.resourcemanager.v3.UpdateProjectMetadata result = + new com.google.cloud.resourcemanager.v3.UpdateProjectMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.UpdateProjectMetadata) { + return mergeFrom((com.google.cloud.resourcemanager.v3.UpdateProjectMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.UpdateProjectMetadata other) { + if (other == com.google.cloud.resourcemanager.v3.UpdateProjectMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.UpdateProjectMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.UpdateProjectMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.UpdateProjectMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.UpdateProjectMetadata) + private static final com.google.cloud.resourcemanager.v3.UpdateProjectMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.UpdateProjectMetadata(); + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateProjectMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateProjectMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateProjectMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateProjectMetadataOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateProjectMetadataOrBuilder.java new file mode 100644 index 000000000000..a7d8afd1f0c2 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateProjectMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +public interface UpdateProjectMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.UpdateProjectMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateProjectRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateProjectRequest.java new file mode 100644 index 000000000000..f4d00546d889 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateProjectRequest.java @@ -0,0 +1,1052 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The request sent to the
+ * [UpdateProject][google.cloud.resourcemanager.v3.Projects.UpdateProject]
+ * method.
+ * Only the `display_name` and `labels` fields can be change. Use the
+ * [MoveProject][google.cloud.resourcemanager.v3.Projects.MoveProject] method to
+ * change the `parent` field.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UpdateProjectRequest} + */ +public final class UpdateProjectRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.UpdateProjectRequest) + UpdateProjectRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateProjectRequest.newBuilder() to construct. + private UpdateProjectRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateProjectRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateProjectRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateProjectRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.resourcemanager.v3.Project.Builder subBuilder = null; + if (project_ != null) { + subBuilder = project_.toBuilder(); + } + project_ = + input.readMessage( + com.google.cloud.resourcemanager.v3.Project.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(project_); + project_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_UpdateProjectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_UpdateProjectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UpdateProjectRequest.class, + com.google.cloud.resourcemanager.v3.UpdateProjectRequest.Builder.class); + } + + public static final int PROJECT_FIELD_NUMBER = 1; + private com.google.cloud.resourcemanager.v3.Project project_; + /** + * + * + *
+   * Required. The new definition of the project.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the project field is set. + */ + @java.lang.Override + public boolean hasProject() { + return project_ != null; + } + /** + * + * + *
+   * Required. The new definition of the project.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The project. + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.Project getProject() { + return project_ == null + ? com.google.cloud.resourcemanager.v3.Project.getDefaultInstance() + : project_; + } + /** + * + * + *
+   * Required. The new definition of the project.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.ProjectOrBuilder getProjectOrBuilder() { + return getProject(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. An update mask to selectively update fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Optional. An update mask to selectively update fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. An update mask to selectively update fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (project_ != null) { + output.writeMessage(1, getProject()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (project_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getProject()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.UpdateProjectRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.UpdateProjectRequest other = + (com.google.cloud.resourcemanager.v3.UpdateProjectRequest) obj; + + if (hasProject() != other.hasProject()) return false; + if (hasProject()) { + if (!getProject().equals(other.getProject())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasProject()) { + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.UpdateProjectRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request sent to the
+   * [UpdateProject][google.cloud.resourcemanager.v3.Projects.UpdateProject]
+   * method.
+   * Only the `display_name` and `labels` fields can be change. Use the
+   * [MoveProject][google.cloud.resourcemanager.v3.Projects.MoveProject] method to
+   * change the `parent` field.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UpdateProjectRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.UpdateProjectRequest) + com.google.cloud.resourcemanager.v3.UpdateProjectRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_UpdateProjectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_UpdateProjectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UpdateProjectRequest.class, + com.google.cloud.resourcemanager.v3.UpdateProjectRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.UpdateProjectRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (projectBuilder_ == null) { + project_ = null; + } else { + project_ = null; + projectBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.ProjectsProto + .internal_static_google_cloud_resourcemanager_v3_UpdateProjectRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateProjectRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.UpdateProjectRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateProjectRequest build() { + com.google.cloud.resourcemanager.v3.UpdateProjectRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateProjectRequest buildPartial() { + com.google.cloud.resourcemanager.v3.UpdateProjectRequest result = + new com.google.cloud.resourcemanager.v3.UpdateProjectRequest(this); + if (projectBuilder_ == null) { + result.project_ = project_; + } else { + result.project_ = projectBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.UpdateProjectRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.UpdateProjectRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.UpdateProjectRequest other) { + if (other == com.google.cloud.resourcemanager.v3.UpdateProjectRequest.getDefaultInstance()) + return this; + if (other.hasProject()) { + mergeProject(other.getProject()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.UpdateProjectRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.UpdateProjectRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.resourcemanager.v3.Project project_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Project, + com.google.cloud.resourcemanager.v3.Project.Builder, + com.google.cloud.resourcemanager.v3.ProjectOrBuilder> + projectBuilder_; + /** + * + * + *
+     * Required. The new definition of the project.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the project field is set. + */ + public boolean hasProject() { + return projectBuilder_ != null || project_ != null; + } + /** + * + * + *
+     * Required. The new definition of the project.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The project. + */ + public com.google.cloud.resourcemanager.v3.Project getProject() { + if (projectBuilder_ == null) { + return project_ == null + ? com.google.cloud.resourcemanager.v3.Project.getDefaultInstance() + : project_; + } else { + return projectBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The new definition of the project.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProject(com.google.cloud.resourcemanager.v3.Project value) { + if (projectBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + project_ = value; + onChanged(); + } else { + projectBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The new definition of the project.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setProject(com.google.cloud.resourcemanager.v3.Project.Builder builderForValue) { + if (projectBuilder_ == null) { + project_ = builderForValue.build(); + onChanged(); + } else { + projectBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The new definition of the project.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeProject(com.google.cloud.resourcemanager.v3.Project value) { + if (projectBuilder_ == null) { + if (project_ != null) { + project_ = + com.google.cloud.resourcemanager.v3.Project.newBuilder(project_) + .mergeFrom(value) + .buildPartial(); + } else { + project_ = value; + } + onChanged(); + } else { + projectBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The new definition of the project.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearProject() { + if (projectBuilder_ == null) { + project_ = null; + onChanged(); + } else { + project_ = null; + projectBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The new definition of the project.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.resourcemanager.v3.Project.Builder getProjectBuilder() { + + onChanged(); + return getProjectFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The new definition of the project.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.resourcemanager.v3.ProjectOrBuilder getProjectOrBuilder() { + if (projectBuilder_ != null) { + return projectBuilder_.getMessageOrBuilder(); + } else { + return project_ == null + ? com.google.cloud.resourcemanager.v3.Project.getDefaultInstance() + : project_; + } + } + /** + * + * + *
+     * Required. The new definition of the project.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Project, + com.google.cloud.resourcemanager.v3.Project.Builder, + com.google.cloud.resourcemanager.v3.ProjectOrBuilder> + getProjectFieldBuilder() { + if (projectBuilder_ == null) { + projectBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.Project, + com.google.cloud.resourcemanager.v3.Project.Builder, + com.google.cloud.resourcemanager.v3.ProjectOrBuilder>( + getProject(), getParentForChildren(), isClean()); + project_ = null; + } + return projectBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Optional. An update mask to selectively update fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Optional. An update mask to selectively update fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. An update mask to selectively update fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. An update mask to selectively update fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. An update mask to selectively update fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. An update mask to selectively update fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. An update mask to selectively update fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. An update mask to selectively update fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. An update mask to selectively update fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.UpdateProjectRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.UpdateProjectRequest) + private static final com.google.cloud.resourcemanager.v3.UpdateProjectRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.UpdateProjectRequest(); + } + + public static com.google.cloud.resourcemanager.v3.UpdateProjectRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateProjectRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateProjectRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateProjectRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateProjectRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateProjectRequestOrBuilder.java new file mode 100644 index 000000000000..7f69f6a79497 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateProjectRequestOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/projects.proto + +package com.google.cloud.resourcemanager.v3; + +public interface UpdateProjectRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.UpdateProjectRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The new definition of the project.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the project field is set. + */ + boolean hasProject(); + /** + * + * + *
+   * Required. The new definition of the project.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The project. + */ + com.google.cloud.resourcemanager.v3.Project getProject(); + /** + * + * + *
+   * Required. The new definition of the project.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.Project project = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.resourcemanager.v3.ProjectOrBuilder getProjectOrBuilder(); + + /** + * + * + *
+   * Optional. An update mask to selectively update fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. An update mask to selectively update fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. An update mask to selectively update fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagKeyMetadata.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagKeyMetadata.java new file mode 100644 index 000000000000..bbea38c99148 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagKeyMetadata.java @@ -0,0 +1,457 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_keys.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * Runtime operation information for updating a TagKey.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UpdateTagKeyMetadata} + */ +public final class UpdateTagKeyMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.UpdateTagKeyMetadata) + UpdateTagKeyMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateTagKeyMetadata.newBuilder() to construct. + private UpdateTagKeyMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateTagKeyMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateTagKeyMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateTagKeyMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_UpdateTagKeyMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_UpdateTagKeyMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata.class, + com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata other = + (com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Runtime operation information for updating a TagKey.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UpdateTagKeyMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.UpdateTagKeyMetadata) + com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_UpdateTagKeyMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_UpdateTagKeyMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata.class, + com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_UpdateTagKeyMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata build() { + com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata buildPartial() { + com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata result = + new com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata) { + return mergeFrom((com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata other) { + if (other == com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.UpdateTagKeyMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.UpdateTagKeyMetadata) + private static final com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata(); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateTagKeyMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateTagKeyMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateTagKeyMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagKeyMetadataOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagKeyMetadataOrBuilder.java new file mode 100644 index 000000000000..cbb567832e2d --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagKeyMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_keys.proto + +package com.google.cloud.resourcemanager.v3; + +public interface UpdateTagKeyMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.UpdateTagKeyMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagKeyRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagKeyRequest.java new file mode 100644 index 000000000000..85acfeb07e7a --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagKeyRequest.java @@ -0,0 +1,1184 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_keys.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The request message for updating a TagKey.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UpdateTagKeyRequest} + */ +public final class UpdateTagKeyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.UpdateTagKeyRequest) + UpdateTagKeyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateTagKeyRequest.newBuilder() to construct. + private UpdateTagKeyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateTagKeyRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateTagKeyRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateTagKeyRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.resourcemanager.v3.TagKey.Builder subBuilder = null; + if (tagKey_ != null) { + subBuilder = tagKey_.toBuilder(); + } + tagKey_ = + input.readMessage( + com.google.cloud.resourcemanager.v3.TagKey.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(tagKey_); + tagKey_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + case 24: + { + validateOnly_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_UpdateTagKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_UpdateTagKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest.class, + com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest.Builder.class); + } + + public static final int TAG_KEY_FIELD_NUMBER = 1; + private com.google.cloud.resourcemanager.v3.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,
+   * `FAILED_PRECONDITION` will be returned.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the tagKey field is set. + */ + @java.lang.Override + public boolean hasTagKey() { + return tagKey_ != null; + } + /** + * + * + *
+   * 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,
+   * `FAILED_PRECONDITION` will be returned.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The tagKey. + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagKey getTagKey() { + return tagKey_ == null + ? com.google.cloud.resourcemanager.v3.TagKey.getDefaultInstance() + : 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,
+   * `FAILED_PRECONDITION` will be returned.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagKeyOrBuilder getTagKeyOrBuilder() { + return getTagKey(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : 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.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_; + /** + * + * + *
+   * Set as true to perform validations necessary for updating the resource, but
+   * not actually perform the action.
+   * 
+ * + * bool validate_only = 3; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (tagKey_ != null) { + output.writeMessage(1, getTagKey()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (tagKey_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getTagKey()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest other = + (com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest) obj; + + if (hasTagKey() != other.hasTagKey()) return false; + if (hasTagKey()) { + if (!getTagKey().equals(other.getTagKey())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasTagKey()) { + hash = (37 * hash) + TAG_KEY_FIELD_NUMBER; + hash = (53 * hash) + getTagKey().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for updating a TagKey.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UpdateTagKeyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.UpdateTagKeyRequest) + com.google.cloud.resourcemanager.v3.UpdateTagKeyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_UpdateTagKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_UpdateTagKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest.class, + com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (tagKeyBuilder_ == null) { + tagKey_ = null; + } else { + tagKey_ = null; + tagKeyBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + validateOnly_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagKeysProto + .internal_static_google_cloud_resourcemanager_v3_UpdateTagKeyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest build() { + com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest buildPartial() { + com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest result = + new com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest(this); + if (tagKeyBuilder_ == null) { + result.tagKey_ = tagKey_; + } else { + result.tagKey_ = tagKeyBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + result.validateOnly_ = validateOnly_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest other) { + if (other == com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest.getDefaultInstance()) + return this; + if (other.hasTagKey()) { + mergeTagKey(other.getTagKey()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.resourcemanager.v3.TagKey tagKey_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.TagKey, + com.google.cloud.resourcemanager.v3.TagKey.Builder, + com.google.cloud.resourcemanager.v3.TagKeyOrBuilder> + tagKeyBuilder_; + /** + * + * + *
+     * 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,
+     * `FAILED_PRECONDITION` will be returned.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the tagKey field is set. + */ + public boolean hasTagKey() { + return tagKeyBuilder_ != null || tagKey_ != null; + } + /** + * + * + *
+     * 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,
+     * `FAILED_PRECONDITION` will be returned.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The tagKey. + */ + public com.google.cloud.resourcemanager.v3.TagKey getTagKey() { + if (tagKeyBuilder_ == null) { + return tagKey_ == null + ? com.google.cloud.resourcemanager.v3.TagKey.getDefaultInstance() + : tagKey_; + } else { + return tagKeyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * 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,
+     * `FAILED_PRECONDITION` will be returned.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTagKey(com.google.cloud.resourcemanager.v3.TagKey value) { + if (tagKeyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tagKey_ = value; + onChanged(); + } else { + tagKeyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * 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,
+     * `FAILED_PRECONDITION` will be returned.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTagKey(com.google.cloud.resourcemanager.v3.TagKey.Builder builderForValue) { + if (tagKeyBuilder_ == null) { + tagKey_ = builderForValue.build(); + onChanged(); + } else { + tagKeyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * 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,
+     * `FAILED_PRECONDITION` will be returned.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeTagKey(com.google.cloud.resourcemanager.v3.TagKey value) { + if (tagKeyBuilder_ == null) { + if (tagKey_ != null) { + tagKey_ = + com.google.cloud.resourcemanager.v3.TagKey.newBuilder(tagKey_) + .mergeFrom(value) + .buildPartial(); + } else { + tagKey_ = value; + } + onChanged(); + } else { + tagKeyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * 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,
+     * `FAILED_PRECONDITION` will be returned.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearTagKey() { + if (tagKeyBuilder_ == null) { + tagKey_ = null; + onChanged(); + } else { + tagKey_ = null; + tagKeyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * 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,
+     * `FAILED_PRECONDITION` will be returned.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.resourcemanager.v3.TagKey.Builder getTagKeyBuilder() { + + onChanged(); + return getTagKeyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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,
+     * `FAILED_PRECONDITION` will be returned.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.resourcemanager.v3.TagKeyOrBuilder getTagKeyOrBuilder() { + if (tagKeyBuilder_ != null) { + return tagKeyBuilder_.getMessageOrBuilder(); + } else { + return tagKey_ == null + ? com.google.cloud.resourcemanager.v3.TagKey.getDefaultInstance() + : 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,
+     * `FAILED_PRECONDITION` will be returned.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.TagKey, + com.google.cloud.resourcemanager.v3.TagKey.Builder, + com.google.cloud.resourcemanager.v3.TagKeyOrBuilder> + getTagKeyFieldBuilder() { + if (tagKeyBuilder_ == null) { + tagKeyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.TagKey, + com.google.cloud.resourcemanager.v3.TagKey.Builder, + com.google.cloud.resourcemanager.v3.TagKeyOrBuilder>( + getTagKey(), getParentForChildren(), isClean()); + tagKey_ = null; + } + return tagKeyBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Fields to be updated. The mask may only contain `description` or
+     * `etag`. If omitted entirely, both `description` and `etag` are assumed to
+     * be significant.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Fields to be updated. The mask may only contain `description` or
+     * `etag`. If omitted entirely, both `description` and `etag` are assumed to
+     * be significant.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Fields to be updated. The mask may only contain `description` or
+     * `etag`. If omitted entirely, both `description` and `etag` are assumed to
+     * be significant.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : 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.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Set as true to perform validations necessary for updating the resource, but
+     * not actually perform the action.
+     * 
+ * + * bool validate_only = 3; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Set as true to perform validations necessary for updating the resource, but
+     * not actually perform the action.
+     * 
+ * + * bool validate_only = 3; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Set as true to perform validations necessary for updating the resource, but
+     * not actually perform the action.
+     * 
+ * + * bool validate_only = 3; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + + validateOnly_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.UpdateTagKeyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.UpdateTagKeyRequest) + private static final com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest(); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateTagKeyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateTagKeyRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateTagKeyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagKeyRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagKeyRequestOrBuilder.java new file mode 100644 index 000000000000..6a0d2046847e --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagKeyRequestOrBuilder.java @@ -0,0 +1,130 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_keys.proto + +package com.google.cloud.resourcemanager.v3; + +public interface UpdateTagKeyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.UpdateTagKeyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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,
+   * `FAILED_PRECONDITION` will be returned.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the tagKey field is set. + */ + boolean hasTagKey(); + /** + * + * + *
+   * 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,
+   * `FAILED_PRECONDITION` will be returned.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The tagKey. + */ + com.google.cloud.resourcemanager.v3.TagKey getTagKey(); + /** + * + * + *
+   * 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,
+   * `FAILED_PRECONDITION` will be returned.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagKey tag_key = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.resourcemanager.v3.TagKeyOrBuilder getTagKeyOrBuilder(); + + /** + * + * + *
+   * Fields to be updated. The mask may only contain `description` or
+   * `etag`. If omitted entirely, both `description` and `etag` are assumed to
+   * be significant.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Fields to be updated. The mask may only contain `description` or
+   * `etag`. If omitted entirely, both `description` and `etag` are assumed to
+   * be significant.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Fields to be updated. The mask may only contain `description` or
+   * `etag`. If omitted entirely, both `description` and `etag` are assumed to
+   * be significant.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Set as true to perform validations necessary for updating the resource, but
+   * not actually perform the action.
+   * 
+ * + * bool validate_only = 3; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagValueMetadata.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagValueMetadata.java new file mode 100644 index 000000000000..011c7e471e81 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagValueMetadata.java @@ -0,0 +1,457 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_values.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * Runtime operation information for updating a TagValue.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UpdateTagValueMetadata} + */ +public final class UpdateTagValueMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.UpdateTagValueMetadata) + UpdateTagValueMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateTagValueMetadata.newBuilder() to construct. + private UpdateTagValueMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateTagValueMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateTagValueMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateTagValueMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_UpdateTagValueMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_UpdateTagValueMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata.class, + com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata other = + (com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Runtime operation information for updating a TagValue.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UpdateTagValueMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.UpdateTagValueMetadata) + com.google.cloud.resourcemanager.v3.UpdateTagValueMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_UpdateTagValueMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_UpdateTagValueMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata.class, + com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_UpdateTagValueMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata build() { + com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata buildPartial() { + com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata result = + new com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata) { + return mergeFrom((com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata other) { + if (other == com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.UpdateTagValueMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.UpdateTagValueMetadata) + private static final com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata(); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateTagValueMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateTagValueMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateTagValueMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagValueMetadataOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagValueMetadataOrBuilder.java new file mode 100644 index 000000000000..dd5bcbdf71b5 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagValueMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_values.proto + +package com.google.cloud.resourcemanager.v3; + +public interface UpdateTagValueMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.UpdateTagValueMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagValueRequest.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagValueRequest.java new file mode 100644 index 000000000000..2e11f86723c8 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagValueRequest.java @@ -0,0 +1,1173 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_values.proto + +package com.google.cloud.resourcemanager.v3; + +/** + * + * + *
+ * The request message for updating a TagValue.
+ * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UpdateTagValueRequest} + */ +public final class UpdateTagValueRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.resourcemanager.v3.UpdateTagValueRequest) + UpdateTagValueRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateTagValueRequest.newBuilder() to construct. + private UpdateTagValueRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateTagValueRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateTagValueRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateTagValueRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.resourcemanager.v3.TagValue.Builder subBuilder = null; + if (tagValue_ != null) { + subBuilder = tagValue_.toBuilder(); + } + tagValue_ = + input.readMessage( + com.google.cloud.resourcemanager.v3.TagValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(tagValue_); + tagValue_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + case 24: + { + validateOnly_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_UpdateTagValueRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_UpdateTagValueRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UpdateTagValueRequest.class, + com.google.cloud.resourcemanager.v3.UpdateTagValueRequest.Builder.class); + } + + public static final int TAG_VALUE_FIELD_NUMBER = 1; + private com.google.cloud.resourcemanager.v3.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,
+   * `FAILED_PRECONDITION` will be returned.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the tagValue field is set. + */ + @java.lang.Override + public boolean hasTagValue() { + return tagValue_ != null; + } + /** + * + * + *
+   * 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,
+   * `FAILED_PRECONDITION` will be returned.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The tagValue. + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagValue getTagValue() { + return tagValue_ == null + ? com.google.cloud.resourcemanager.v3.TagValue.getDefaultInstance() + : 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,
+   * `FAILED_PRECONDITION` will be returned.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.resourcemanager.v3.TagValueOrBuilder getTagValueOrBuilder() { + return getTagValue(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. Fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Optional. Fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. Fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_; + /** + * + * + *
+   * Optional. True to perform validations necessary for updating the resource, but not
+   * actually perform the action.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (tagValue_ != null) { + output.writeMessage(1, getTagValue()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (tagValue_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getTagValue()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.resourcemanager.v3.UpdateTagValueRequest)) { + return super.equals(obj); + } + com.google.cloud.resourcemanager.v3.UpdateTagValueRequest other = + (com.google.cloud.resourcemanager.v3.UpdateTagValueRequest) obj; + + if (hasTagValue() != other.hasTagValue()) return false; + if (hasTagValue()) { + if (!getTagValue().equals(other.getTagValue())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasTagValue()) { + hash = (37 * hash) + TAG_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getTagValue().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.resourcemanager.v3.UpdateTagValueRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for updating a TagValue.
+   * 
+ * + * Protobuf type {@code google.cloud.resourcemanager.v3.UpdateTagValueRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.resourcemanager.v3.UpdateTagValueRequest) + com.google.cloud.resourcemanager.v3.UpdateTagValueRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_UpdateTagValueRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_UpdateTagValueRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.resourcemanager.v3.UpdateTagValueRequest.class, + com.google.cloud.resourcemanager.v3.UpdateTagValueRequest.Builder.class); + } + + // Construct using com.google.cloud.resourcemanager.v3.UpdateTagValueRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (tagValueBuilder_ == null) { + tagValue_ = null; + } else { + tagValue_ = null; + tagValueBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + validateOnly_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.resourcemanager.v3.TagValuesProto + .internal_static_google_cloud_resourcemanager_v3_UpdateTagValueRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateTagValueRequest getDefaultInstanceForType() { + return com.google.cloud.resourcemanager.v3.UpdateTagValueRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateTagValueRequest build() { + com.google.cloud.resourcemanager.v3.UpdateTagValueRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateTagValueRequest buildPartial() { + com.google.cloud.resourcemanager.v3.UpdateTagValueRequest result = + new com.google.cloud.resourcemanager.v3.UpdateTagValueRequest(this); + if (tagValueBuilder_ == null) { + result.tagValue_ = tagValue_; + } else { + result.tagValue_ = tagValueBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + result.validateOnly_ = validateOnly_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.resourcemanager.v3.UpdateTagValueRequest) { + return mergeFrom((com.google.cloud.resourcemanager.v3.UpdateTagValueRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.resourcemanager.v3.UpdateTagValueRequest other) { + if (other == com.google.cloud.resourcemanager.v3.UpdateTagValueRequest.getDefaultInstance()) + return this; + if (other.hasTagValue()) { + mergeTagValue(other.getTagValue()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.resourcemanager.v3.UpdateTagValueRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.resourcemanager.v3.UpdateTagValueRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.resourcemanager.v3.TagValue tagValue_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.TagValue, + com.google.cloud.resourcemanager.v3.TagValue.Builder, + com.google.cloud.resourcemanager.v3.TagValueOrBuilder> + tagValueBuilder_; + /** + * + * + *
+     * 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,
+     * `FAILED_PRECONDITION` will be returned.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the tagValue field is set. + */ + public boolean hasTagValue() { + return tagValueBuilder_ != null || tagValue_ != null; + } + /** + * + * + *
+     * 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,
+     * `FAILED_PRECONDITION` will be returned.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The tagValue. + */ + public com.google.cloud.resourcemanager.v3.TagValue getTagValue() { + if (tagValueBuilder_ == null) { + return tagValue_ == null + ? com.google.cloud.resourcemanager.v3.TagValue.getDefaultInstance() + : tagValue_; + } else { + return tagValueBuilder_.getMessage(); + } + } + /** + * + * + *
+     * 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,
+     * `FAILED_PRECONDITION` will be returned.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTagValue(com.google.cloud.resourcemanager.v3.TagValue value) { + if (tagValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tagValue_ = value; + onChanged(); + } else { + tagValueBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * 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,
+     * `FAILED_PRECONDITION` will be returned.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTagValue( + com.google.cloud.resourcemanager.v3.TagValue.Builder builderForValue) { + if (tagValueBuilder_ == null) { + tagValue_ = builderForValue.build(); + onChanged(); + } else { + tagValueBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * 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,
+     * `FAILED_PRECONDITION` will be returned.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeTagValue(com.google.cloud.resourcemanager.v3.TagValue value) { + if (tagValueBuilder_ == null) { + if (tagValue_ != null) { + tagValue_ = + com.google.cloud.resourcemanager.v3.TagValue.newBuilder(tagValue_) + .mergeFrom(value) + .buildPartial(); + } else { + tagValue_ = value; + } + onChanged(); + } else { + tagValueBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * 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,
+     * `FAILED_PRECONDITION` will be returned.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearTagValue() { + if (tagValueBuilder_ == null) { + tagValue_ = null; + onChanged(); + } else { + tagValue_ = null; + tagValueBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * 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,
+     * `FAILED_PRECONDITION` will be returned.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.resourcemanager.v3.TagValue.Builder getTagValueBuilder() { + + onChanged(); + return getTagValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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,
+     * `FAILED_PRECONDITION` will be returned.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.resourcemanager.v3.TagValueOrBuilder getTagValueOrBuilder() { + if (tagValueBuilder_ != null) { + return tagValueBuilder_.getMessageOrBuilder(); + } else { + return tagValue_ == null + ? com.google.cloud.resourcemanager.v3.TagValue.getDefaultInstance() + : 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,
+     * `FAILED_PRECONDITION` will be returned.
+     * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.TagValue, + com.google.cloud.resourcemanager.v3.TagValue.Builder, + com.google.cloud.resourcemanager.v3.TagValueOrBuilder> + getTagValueFieldBuilder() { + if (tagValueBuilder_ == null) { + tagValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.resourcemanager.v3.TagValue, + com.google.cloud.resourcemanager.v3.TagValue.Builder, + com.google.cloud.resourcemanager.v3.TagValueOrBuilder>( + getTagValue(), getParentForChildren(), isClean()); + tagValue_ = null; + } + return tagValueBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Optional. Fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Optional. Fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. Fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. True to perform validations necessary for updating the resource, but not
+     * actually perform the action.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. True to perform validations necessary for updating the resource, but not
+     * actually perform the action.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. True to perform validations necessary for updating the resource, but not
+     * actually perform the action.
+     * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + + validateOnly_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.resourcemanager.v3.UpdateTagValueRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.resourcemanager.v3.UpdateTagValueRequest) + private static final com.google.cloud.resourcemanager.v3.UpdateTagValueRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.resourcemanager.v3.UpdateTagValueRequest(); + } + + public static com.google.cloud.resourcemanager.v3.UpdateTagValueRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateTagValueRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateTagValueRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.resourcemanager.v3.UpdateTagValueRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagValueRequestOrBuilder.java b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagValueRequestOrBuilder.java new file mode 100644 index 000000000000..bb6a16bce169 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/java/com/google/cloud/resourcemanager/v3/UpdateTagValueRequestOrBuilder.java @@ -0,0 +1,127 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/resourcemanager/v3/tag_values.proto + +package com.google.cloud.resourcemanager.v3; + +public interface UpdateTagValueRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.resourcemanager.v3.UpdateTagValueRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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,
+   * `FAILED_PRECONDITION` will be returned.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the tagValue field is set. + */ + boolean hasTagValue(); + /** + * + * + *
+   * 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,
+   * `FAILED_PRECONDITION` will be returned.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The tagValue. + */ + com.google.cloud.resourcemanager.v3.TagValue getTagValue(); + /** + * + * + *
+   * 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,
+   * `FAILED_PRECONDITION` will be returned.
+   * 
+ * + * + * .google.cloud.resourcemanager.v3.TagValue tag_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.resourcemanager.v3.TagValueOrBuilder getTagValueOrBuilder(); + + /** + * + * + *
+   * Optional. Fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. Fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. Fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Optional. True to perform validations necessary for updating the resource, but not
+   * actually perform the action.
+   * 
+ * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/proto/google/cloud/resourcemanager/v3/folders.proto b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/proto/google/cloud/resourcemanager/v3/folders.proto new file mode 100644 index 000000000000..d7430b74862c --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/proto/google/cloud/resourcemanager/v3/folders.proto @@ -0,0 +1,533 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.resourcemanager.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ResourceManager.V3"; +option go_package = "google.golang.org/genproto/googleapis/cloud/resourcemanager/v3;resourcemanager"; +option java_multiple_files = true; +option java_outer_classname = "FoldersProto"; +option java_package = "com.google.cloud.resourcemanager.v3"; +option php_namespace = "Google\\Cloud\\ResourceManager\\V3"; + +// Manages Cloud Platform folder resources. +// Folders can be used to organize the resources under an +// organization and to control the policies applied to groups of resources. +service Folders { + option (google.api.default_host) = "cloudresourcemanager.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // 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. + rpc GetFolder(GetFolderRequest) returns (Folder) { + option (google.api.http) = { + get: "/v3/{name=folders/*}" + }; + option (google.api.method_signature) = "name"; + } + + // 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. + rpc ListFolders(ListFoldersRequest) returns (ListFoldersResponse) { + option (google.api.http) = { + get: "/v3/folders" + }; + option (google.api.method_signature) = "parent"; + } + + // 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`. + rpc SearchFolders(SearchFoldersRequest) returns (SearchFoldersResponse) { + option (google.api.http) = { + get: "/v3/folders:search" + }; + option (google.api.method_signature) = "query"; + } + + // 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. + rpc CreateFolder(CreateFolderRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/folders" + body: "folder" + }; + option (google.api.method_signature) = "folder"; + option (google.longrunning.operation_info) = { + response_type: "Folder" + metadata_type: "CreateFolderMetadata" + }; + } + + // 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. + rpc UpdateFolder(UpdateFolderRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v3/{folder.name=folders/*}" + body: "folder" + }; + option (google.api.method_signature) = "folder,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Folder" + metadata_type: "UpdateFolderMetadata" + }; + } + + // 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. + rpc MoveFolder(MoveFolderRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{name=folders/*}:move" + body: "*" + }; + option (google.api.method_signature) = "name,destination_parent"; + option (google.longrunning.operation_info) = { + response_type: "Folder" + metadata_type: "MoveFolderMetadata" + }; + } + + // 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. + rpc DeleteFolder(DeleteFolderRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v3/{name=folders/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Folder" + metadata_type: "DeleteFolderMetadata" + }; + } + + // 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. + rpc UndeleteFolder(UndeleteFolderRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{name=folders/*}:undelete" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Folder" + metadata_type: "UndeleteFolderMetadata" + }; + } + + // 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. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v3/{resource=folders/*}:getIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource"; + } + + // 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. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v3/{resource=folders/*}:setIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource,policy"; + } + + // 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. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v3/{resource=folders/*}:testIamPermissions" + body: "*" + }; + option (google.api.method_signature) = "resource,permissions"; + } +} + +// A folder in an organization's resource hierarchy, used to +// organize that organization's resources. +message Folder { + option (google.api.resource) = { + type: "cloudresourcemanager.googleapis.com/Folder" + pattern: "folders/{folder}" + style: DECLARATIVE_FRIENDLY + }; + + // Folder lifecycle states. + enum State { + // Unspecified state. + STATE_UNSPECIFIED = 0; + + // The normal and active state. + ACTIVE = 1; + + // The folder has been marked for deletion by the user. + DELETE_REQUESTED = 2; + } + + // Output only. The resource name of the folder. + // Its format is `folders/{folder_id}`, for example: "folders/1234". + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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]. + string parent = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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}])?`. + string display_name = 3; + + // 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]. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the folder was created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the folder was last modified. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the folder was requested to be deleted. + google.protobuf.Timestamp delete_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + string etag = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The GetFolder request message. +message GetFolderRequest { + // Required. The resource name of the folder to retrieve. + // Must be of the form `folders/{folder_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Folder" + } + ]; +} + +// The ListFolders request message. +message ListFoldersRequest { + // Required. The resource name of the organization or folder whose folders are + // being listed. + // Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + // Access to this method is controlled by checking the + // `resourcemanager.folders.list` permission on the `parent`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "*" + } + ]; + + // Optional. The maximum number of folders to return in the response. + // If unspecified, server picks an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A pagination token returned from a previous call to `ListFolders` + // that indicates where this listing should continue from. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Controls whether folders in the + // [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED] + // state should be returned. Defaults to false. + bool show_deleted = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The ListFolders response message. +message ListFoldersResponse { + // A possibly paginated list of folders that are direct descendants of + // the specified parent resource. + repeated Folder folders = 1; + + // A pagination token returned from a previous call to `ListFolders` + // that indicates from where listing should continue. + string next_page_token = 2; +} + +// The request message for searching folders. +message SearchFoldersRequest { + // Optional. The maximum number of folders to return in the response. + // If unspecified, server picks an appropriate default. + int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A pagination token returned from a previous call to `SearchFolders` + // that indicates from where search should continue. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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". + string query = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for searching folders. +message SearchFoldersResponse { + // A possibly paginated folder search results. + // the specified parent resource. + repeated Folder folders = 1; + + // A pagination token returned from a previous call to `SearchFolders` + // that indicates from where searching should continue. + string next_page_token = 2; +} + +// The CreateFolder request message. +message CreateFolderRequest { + // Required. The folder being created, only the display name and parent will be + // consulted. All other fields will be ignored. + Folder folder = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Metadata pertaining to the Folder creation process. +message CreateFolderMetadata { + // The display name of the folder. + string display_name = 1; + + // The resource name of the folder or organization we are creating the folder + // under. + string parent = 2; +} + +// The request sent to the +// [UpdateFolder][google.cloud.resourcemanager.v3.Folder.UpdateFolder] +// method. +// +// Only the `display_name` field can be changed. All other fields will be +// ignored. Use the +// [MoveFolder][google.cloud.resourcemanager.v3.Folders.MoveFolder] method to +// change the `parent` field. +message UpdateFolderRequest { + // Required. The new definition of the Folder. It must include the `name` field, which + // cannot be changed. + Folder folder = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Fields to be updated. + // Only the `display_name` can be updated. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A status object which is used as the `metadata` field for the Operation +// returned by UpdateFolder. +message UpdateFolderMetadata { + +} + +// The MoveFolder request message. +message MoveFolderRequest { + // Required. The resource name of the Folder to move. + // Must be of the form folders/{folder_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Folder" + } + ]; + + // 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}`. + string destination_parent = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "*" + } + ]; +} + +// Metadata pertaining to the folder move process. +message MoveFolderMetadata { + // The display name of the folder. + string display_name = 1; + + // The resource name of the folder's parent. + string source_parent = 2; + + // The resource name of the folder or organization to move the folder to. + string destination_parent = 3; +} + +// The DeleteFolder request message. +message DeleteFolderRequest { + // Required. The resource name of the folder to be deleted. + // Must be of the form `folders/{folder_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Folder" + } + ]; +} + +// A status object which is used as the `metadata` field for the `Operation` +// returned by `DeleteFolder`. +message DeleteFolderMetadata { + +} + +// The UndeleteFolder request message. +message UndeleteFolderRequest { + // Required. The resource name of the folder to undelete. + // Must be of the form `folders/{folder_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Folder" + } + ]; +} + +// A status object which is used as the `metadata` field for the `Operation` +// returned by `UndeleteFolder`. +message UndeleteFolderMetadata { + +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/proto/google/cloud/resourcemanager/v3/organizations.proto b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/proto/google/cloud/resourcemanager/v3/organizations.proto new file mode 100644 index 000000000000..14f8c7b97f9d --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/proto/google/cloud/resourcemanager/v3/organizations.proto @@ -0,0 +1,235 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.resourcemanager.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ResourceManager.V3"; +option go_package = "google.golang.org/genproto/googleapis/cloud/resourcemanager/v3;resourcemanager"; +option java_multiple_files = true; +option java_outer_classname = "OrganizationsProto"; +option java_package = "com.google.cloud.resourcemanager.v3"; +option php_namespace = "Google\\Cloud\\ResourceManager\\V3"; + +// Allows users to manage their organization resources. +service Organizations { + option (google.api.default_host) = "cloudresourcemanager.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Fetches an organization resource identified by the specified resource name. + rpc GetOrganization(GetOrganizationRequest) returns (Organization) { + option (google.api.http) = { + get: "/v3/{name=organizations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // 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` + rpc SearchOrganizations(SearchOrganizationsRequest) returns (SearchOrganizationsResponse) { + option (google.api.http) = { + get: "/v3/organizations:search" + }; + option (google.api.method_signature) = "query"; + } + + // 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. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v3/{resource=organizations/*}:getIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource"; + } + + // 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. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v3/{resource=organizations/*}:setIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource"; + } + + // 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. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v3/{resource=organizations/*}:testIamPermissions" + body: "*" + }; + option (google.api.method_signature) = "resource,permissions"; + } +} + +// The root node in the resource hierarchy to which a particular entity's +// (a company, for example) resources belong. +message Organization { + option (google.api.resource) = { + type: "cloudresourcemanager.googleapis.com/Organization" + pattern: "organizations/{organization}" + style: DECLARATIVE_FRIENDLY + }; + + // Organization lifecycle states. + enum State { + // Unspecified state. This is only useful for distinguishing unset values. + STATE_UNSPECIFIED = 0; + + // The normal and active state. + ACTIVE = 1; + + // The organization has been marked for deletion by the user. + DELETE_REQUESTED = 2; + } + + // 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". + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + string display_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The owner of this organization. The owner should be specified on + // creation. Once set, it cannot be changed. + // + // The lifetime of the organization and all of its descendants are bound to + // the owner. If the owner is deleted, the organization and all its + // descendants will be deleted. + oneof owner { + // Immutable. The G Suite / Workspace customer id used in the Directory API. + string directory_customer_id = 3 [(google.api.field_behavior) = IMMUTABLE]; + } + + // Output only. The organization's current lifecycle state. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the Organization was created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the Organization was last modified. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the Organization was requested for deletion. + google.protobuf.Timestamp delete_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + string etag = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request sent to the `GetOrganization` method. The `name` field is +// required. `organization_id` is no longer accepted. +message GetOrganizationRequest { + // 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". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; +} + +// The request sent to the `SearchOrganizations` method. +message SearchOrganizationsRequest { + // Optional. The maximum number of organizations to return in the response. + // If unspecified, server picks an appropriate default. + int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A pagination token returned from a previous call to `SearchOrganizations` + // that indicates from where listing should continue. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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`. + string query = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response returned from the `SearchOrganizations` method. +message SearchOrganizationsResponse { + // The list of Organizations that matched the search query, possibly + // paginated. + repeated Organization organizations = 1; + + // 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. + string next_page_token = 2; +} + +// A status object which is used as the `metadata` field for the operation +// returned by DeleteOrganization. +message DeleteOrganizationMetadata { + +} + +// A status object which is used as the `metadata` field for the Operation +// returned by UndeleteOrganization. +message UndeleteOrganizationMetadata { + +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/proto/google/cloud/resourcemanager/v3/projects.proto b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/proto/google/cloud/resourcemanager/v3/projects.proto new file mode 100644 index 000000000000..5ed8c8a56474 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/proto/google/cloud/resourcemanager/v3/projects.proto @@ -0,0 +1,635 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.resourcemanager.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ResourceManager.V3"; +option go_package = "google.golang.org/genproto/googleapis/cloud/resourcemanager/v3;resourcemanager"; +option java_multiple_files = true; +option java_outer_classname = "ProjectsProto"; +option java_package = "com.google.cloud.resourcemanager.v3"; +option php_namespace = "Google\\Cloud\\ResourceManager\\V3"; + +// Manages Google Cloud Projects. +service Projects { + option (google.api.default_host) = "cloudresourcemanager.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Retrieves the project identified by the specified `name` (for example, + // `projects/415104041262`). + // + // The caller must have `resourcemanager.projects.get` permission + // for this project. + rpc GetProject(GetProjectRequest) returns (Project) { + option (google.api.http) = { + get: "/v3/{name=projects/*}" + }; + option (google.api.method_signature) = "name"; + } + + // 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. + rpc ListProjects(ListProjectsRequest) returns (ListProjectsResponse) { + option (google.api.http) = { + get: "/v3/projects" + }; + option (google.api.method_signature) = "parent"; + } + + // 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. + rpc SearchProjects(SearchProjectsRequest) returns (SearchProjectsResponse) { + option (google.api.http) = { + get: "/v3/projects:search" + }; + option (google.api.method_signature) = "query"; + } + + // 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`. + rpc CreateProject(CreateProjectRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/projects" + body: "project" + }; + option (google.api.method_signature) = "project"; + option (google.longrunning.operation_info) = { + response_type: "Project" + metadata_type: "CreateProjectMetadata" + }; + } + + // 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. + rpc UpdateProject(UpdateProjectRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v3/{project.name=projects/*}" + body: "project" + }; + option (google.api.method_signature) = "project,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Project" + metadata_type: "UpdateProjectMetadata" + }; + } + + // 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.update` permission on the + // project and have `resourcemanager.projects.move` permission on the + // project's current and proposed new parent. + // + // + rpc MoveProject(MoveProjectRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{name=projects/*}:move" + body: "*" + }; + option (google.api.method_signature) = "name, destination_parent"; + option (google.longrunning.operation_info) = { + response_type: "Project" + metadata_type: "MoveProjectMetadata" + }; + } + + // 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. + rpc DeleteProject(DeleteProjectRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v3/{name=projects/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Project" + metadata_type: "DeleteProjectMetadata" + }; + } + + // 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. + rpc UndeleteProject(UndeleteProjectRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{name=projects/*}:undelete" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Project" + metadata_type: "UndeleteProjectMetadata" + }; + } + + // Returns the IAM access control policy for the specified project. + // Permission is denied if the policy or the resource do not exist. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v3/{resource=projects/*}:getIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource"; + } + + // Sets the IAM access control policy for the specified project. + // + // 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. + // + // + Membership changes that leave the project without any owners that have + // accepted the Terms of Service (ToS) will be rejected. + // + // + 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. + // + // + Calling this method requires enabling the App Engine Admin API. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v3/{resource=projects/*}:setIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource, policy"; + } + + // Returns permissions that a caller has on the specified project. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v3/{resource=projects/*}:testIamPermissions" + body: "*" + }; + option (google.api.method_signature) = "resource, permissions"; + } +} + +// A project is a high-level Google Cloud entity. It is a +// container for ACLs, APIs, App Engine Apps, VMs, and other +// Google Cloud Platform resources. +message Project { + option (google.api.resource) = { + type: "cloudresourcemanager.googleapis.com/Project" + pattern: "projects/{project}" + style: DECLARATIVE_FRIENDLY + }; + + // Project lifecycle states. + enum State { + // Unspecified state. This is only used/useful for distinguishing + // unset values. + STATE_UNSPECIFIED = 0; + + // The normal and active state. + 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]. + DELETE_REQUESTED = 2; + } + + // Output only. The unique resource name of the project. It is an int64 generated number + // prefixed by "projects/". + // + // Example: `projects/415104041262` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. A reference to a parent Resource. eg., `organizations/123` or + // `folders/876`. + string parent = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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` + string project_id = 3 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The project lifecycle state. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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` + string display_name = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Creation time. + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The most recent time this resource was modified. + google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this resource was requested for deletion. + google.protobuf.Timestamp delete_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + string etag = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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 256 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"` + map labels = 10 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request sent to the +// [GetProject][google.cloud.resourcemanager.v3.Projects.GetProject] +// method. +message GetProjectRequest { + // Required. The name of the project (for example, `projects/415104041262`). + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; +} + +// The request sent to the +// [ListProjects][google.cloud.resourcemanager.v3.Projects.ListProjects] +// method. +message ListProjectsRequest { + // Required. The name of the parent resource to list projects under. + // + // For example, setting this field to 'folders/1234' would list all projects + // directly under that folder. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "*" + } + ]; + + // Optional. A pagination token returned from a previous call to [ListProjects] + // [google.cloud.resourcemanager.v3.Projects.ListProjects] + // that indicates from where listing should continue. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicate that projects in the `DELETE_REQUESTED` state should also be + // returned. Normally only `ACTIVE` projects are returned. + bool show_deleted = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// A page of the response received from the +// [ListProjects][google.cloud.resourcemanager.v3.Projects.ListProjects] +// method. +// +// A paginated response where more pages are available has +// `next_page_token` set. This token can be used in a subsequent request to +// retrieve the next request page. +// +// NOTE: A response may contain fewer elements than the request `page_size` and +// still have a `next_page_token`. +message ListProjectsResponse { + // The list of Projects under the parent. This list can be paginated. + repeated Project projects = 1; + + // 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. + string next_page_token = 2; +} + +// The request sent to the +// [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects] +// method. +message SearchProjectsRequest { + // 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, the it will return results that match any of the + // fields. Some eligible fields are: + // + // | Field | Description | + // |-------------------------|----------------------------------------------| + // | 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 *key* is the name of a label) | Filters by label + // name. | + // + // Search expressions are case insensitive. + // + // Some examples queries: + // + // | Query | Description | + // |------------------|-----------------------------------------------------| + // | 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` and 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. + string query = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A pagination token returned from a previous call to [ListProjects] + // [google.cloud.resourcemanager.v3.Projects.ListProjects] + // that indicates from where listing should continue. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A page of the response received from the +// [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects] +// method. +// +// A paginated response where more pages are available has +// `next_page_token` set. This token can be used in a subsequent request to +// retrieve the next request page. +message SearchProjectsResponse { + // The list of Projects that matched the list filter query. This list can + // be paginated. + repeated Project projects = 1; + + // 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. + string next_page_token = 2; +} + +// The request sent to the +// [CreateProject][google.cloud.resourcemanager.v3.Projects.CreateProject] +// method. +message CreateProjectRequest { + // 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 Organziation, the parent + // will be set to that Organization. + Project project = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// A status object which is used as the `metadata` field for the Operation +// returned by CreateProject. It provides insight for when significant phases of +// Project creation have completed. +message CreateProjectMetadata { + // Creation time of the project creation workflow. + google.protobuf.Timestamp create_time = 1; + + // 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. + bool gettable = 2; + + // True if the project creation process is complete. + bool ready = 3; +} + +// The request sent to the +// [UpdateProject][google.cloud.resourcemanager.v3.Projects.UpdateProject] +// method. +// +// Only the `display_name` and `labels` fields can be change. Use the +// [MoveProject][google.cloud.resourcemanager.v3.Projects.MoveProject] method to +// change the `parent` field. +message UpdateProjectRequest { + // Required. The new definition of the project. + Project project = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An update mask to selectively update fields. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A status object which is used as the `metadata` field for the Operation +// returned by UpdateProject. +message UpdateProjectMetadata { + +} + +// The request sent to +// [MoveProject][google.cloud.resourcemanager.v3.Projects.MoveProject] +// method. +message MoveProjectRequest { + // Required. The name of the project to move. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. The new parent to move the Project under. + string destination_parent = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "*" + } + ]; +} + +// A status object which is used as the `metadata` field for the Operation +// returned by MoveProject. +message MoveProjectMetadata { + +} + +// [DeleteProject][google.cloud.resourcemanager.v3.Projects.DeleteProject] +// method. +message DeleteProjectRequest { + // Required. The name of the Project (for example, `projects/415104041262`). + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; +} + +// A status object which is used as the `metadata` field for the Operation +// returned by `DeleteProject`. +message DeleteProjectMetadata { + +} + +// The request sent to the [UndeleteProject] +// [google.cloud.resourcemanager.v3.Projects.UndeleteProject] +// method. +message UndeleteProjectRequest { + // Required. The name of the project (for example, `projects/415104041262`). + // + // Required. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; +} + +// A status object which is used as the `metadata` field for the Operation +// returned by `UndeleteProject`. +message UndeleteProjectMetadata { + +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/proto/google/cloud/resourcemanager/v3/tag_bindings.proto b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/proto/google/cloud/resourcemanager/v3/tag_bindings.proto new file mode 100644 index 000000000000..94478ad8da5e --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/proto/google/cloud/resourcemanager/v3/tag_bindings.proto @@ -0,0 +1,176 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.resourcemanager.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.ResourceManager.V3"; +option go_package = "google.golang.org/genproto/googleapis/cloud/resourcemanager/v3;resourcemanager"; +option java_multiple_files = true; +option java_outer_classname = "TagBindingsProto"; +option java_package = "com.google.cloud.resourcemanager.v3"; +option php_namespace = "Google\\Cloud\\ResourceManager\\V3"; + +// Allow users to create and manage TagBindings between TagValues and +// different cloud resources throughout the GCP resource hierarchy. +service TagBindings { + option (google.api.default_host) = "cloudresourcemanager.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Lists the TagBindings for the given 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 + rpc ListTagBindings(ListTagBindingsRequest) returns (ListTagBindingsResponse) { + option (google.api.http) = { + get: "/v3/tagBindings" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a TagBinding between a TagValue and a cloud resource + // (currently project, folder, or organization). + rpc CreateTagBinding(CreateTagBindingRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/tagBindings" + body: "tag_binding" + }; + option (google.api.method_signature) = "tag_binding"; + option (google.longrunning.operation_info) = { + response_type: "TagBinding" + metadata_type: "CreateTagBindingMetadata" + }; + } + + // Deletes a TagBinding. + rpc DeleteTagBinding(DeleteTagBindingRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v3/{name=tagBindings/**}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteTagBindingMetadata" + }; + } +} + +// A TagBinding represents a connection between a TagValue and a cloud +// resource (currently project, folder, or organization). Once a TagBinding is +// created, the TagValue is applied to all the descendants of the cloud +// resource. +message TagBinding { + option (google.api.resource) = { + type: "cloudresourcemanager.googleapis.com/TagBinding" + pattern: "tagBindings/{tag_binding}" + }; + + // 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`). + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The full resource name of the resource the TagValue is bound to. + // E.g. `//cloudresourcemanager.googleapis.com/projects/123` + string parent = 2; + + // The TagValue of the TagBinding. + // Must be of the form `tagValues/456`. + string tag_value = 3; +} + +// Runtime operation information for creating a TagValue. +message CreateTagBindingMetadata { + +} + +// The request message to create a TagBinding. +message CreateTagBindingRequest { + // Required. The TagBinding to be created. + TagBinding tag_binding = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Set to true to perform the validations necessary for creating the resource, + // but not actually perform the action. + bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Runtime operation information for deleting a TagBinding. +message DeleteTagBindingMetadata { + +} + +// The request message to delete a TagBinding. +message DeleteTagBindingRequest { + // 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`). + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/TagBinding" + } + ]; +} + +// The request message to list all TagBindings for a parent. +message ListTagBindingsRequest { + // Required. The full resource name of a resource for which you want to list existing + // TagBindings. + // E.g. "//cloudresourcemanager.googleapis.com/projects/123" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "*" + } + ]; + + // 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. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A pagination token returned from a previous call to `ListTagBindings` + // that indicates where this listing should continue from. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The ListTagBindings response. +message ListTagBindingsResponse { + // A possibly paginated list of TagBindings for the specified TagValue or + // resource. + repeated TagBinding tag_bindings = 1; + + // 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. + string next_page_token = 2; +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/proto/google/cloud/resourcemanager/v3/tag_keys.proto b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/proto/google/cloud/resourcemanager/v3/tag_keys.proto new file mode 100644 index 000000000000..74f25a88d641 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/proto/google/cloud/resourcemanager/v3/tag_keys.proto @@ -0,0 +1,299 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.resourcemanager.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ResourceManager.V3"; +option go_package = "google.golang.org/genproto/googleapis/cloud/resourcemanager/v3;resourcemanager"; +option java_multiple_files = true; +option java_outer_classname = "TagKeysProto"; +option java_package = "com.google.cloud.resourcemanager.v3"; +option php_namespace = "Google\\Cloud\\ResourceManager\\V3"; + +// Allow users to create and manage tag keys. +service TagKeys { + option (google.api.default_host) = "cloudresourcemanager.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Lists all TagKeys for a parent resource. + rpc ListTagKeys(ListTagKeysRequest) returns (ListTagKeysResponse) { + option (google.api.http) = { + get: "/v3/tagKeys" + }; + option (google.api.method_signature) = "parent"; + } + + // 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. + rpc GetTagKey(GetTagKeyRequest) returns (TagKey) { + option (google.api.http) = { + get: "/v3/{name=tagKeys/*}" + }; + option (google.api.method_signature) = "name"; + } + + // 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 300 TagKeys can exist under a parent at + // any given time. + rpc CreateTagKey(CreateTagKeyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/tagKeys" + body: "tag_key" + }; + option (google.api.method_signature) = "tag_key"; + option (google.longrunning.operation_info) = { + response_type: "TagKey" + metadata_type: "CreateTagKeyMetadata" + }; + } + + // Updates the attributes of the TagKey resource. + rpc UpdateTagKey(UpdateTagKeyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v3/{tag_key.name=tagKeys/*}" + body: "tag_key" + }; + option (google.api.method_signature) = "tag_key,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "TagKey" + metadata_type: "UpdateTagKeyMetadata" + }; + } + + // Deletes a TagKey. The TagKey cannot be deleted if it has any child + // TagValues. + rpc DeleteTagKey(DeleteTagKeyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v3/{name=tagKeys/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "TagKey" + metadata_type: "DeleteTagKeyMetadata" + }; + } + + // 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. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v3/{resource=tagKeys/*}:getIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource"; + } + + // 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. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v3/{resource=tagKeys/*}:setIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource,policy"; + } + + // 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. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v3/{resource=tagKeys/*}:testIamPermissions" + body: "*" + }; + option (google.api.method_signature) = "resource,permissions"; + } +} + +// A TagKey, used to group a set of TagValues. +message TagKey { + option (google.api.resource) = { + type: "cloudresourcemanager.googleapis.com/TagKey" + pattern: "tagKeys/{tag_key}" + style: DECLARATIVE_FRIENDLY + }; + + // 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. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The resource name of the new TagKey's parent. + // Must be of the form `organizations/{org_id}`. + string parent = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // 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. + string short_name = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Immutable. Namespaced name of the TagKey. + string namespaced_name = 4 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. User-assigned description of the TagKey. Must not exceed 256 characters. + // + // Read-write. + string description = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Creation time. + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time. + google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Entity tag which users can pass to prevent race conditions. This field is + // always set in server responses. See UpdateTagKeyRequest for details. + string etag = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request message for listing all TagKeys under a parent resource. +message ListTagKeysRequest { + // Required. The resource name of the new TagKey's parent. + // Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "*" + } + ]; + + // 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. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A pagination token returned from a previous call to `ListTagKey` + // that indicates where this listing should continue from. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The ListTagKeys response message. +message ListTagKeysResponse { + // List of TagKeys that live under the specified parent in the request. + repeated TagKey tag_keys = 1; + + // A pagination token returned from a previous call to `ListTagKeys` + // that indicates from where listing should continue. + string next_page_token = 2; +} + +// The request message for getting a TagKey. +message GetTagKeyRequest { + // Required. A resource name in the format `tagKeys/{id}`, such as + // `tagKeys/123`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/TagKey" + } + ]; +} + +// The request message for creating a TagKey. +message CreateTagKeyRequest { + // Required. The TagKey to be created. Only fields `short_name`, `description`, + // and `parent` are considered during the creation request. + TagKey tag_key = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Set to true to perform validations necessary for creating the resource, but + // not actually perform the action. + bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Runtime operation information for creating a TagKey. +message CreateTagKeyMetadata { + +} + +// The request message for updating a TagKey. +message UpdateTagKeyRequest { + // 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, + // `FAILED_PRECONDITION` will be returned. + TagKey tag_key = 1 [(google.api.field_behavior) = REQUIRED]; + + // Fields to be updated. The mask may only contain `description` or + // `etag`. If omitted entirely, both `description` and `etag` are assumed to + // be significant. + google.protobuf.FieldMask update_mask = 2; + + // Set as true to perform validations necessary for updating the resource, but + // not actually perform the action. + bool validate_only = 3; +} + +// Runtime operation information for updating a TagKey. +message UpdateTagKeyMetadata { + +} + +// The request message for deleting a TagKey. +message DeleteTagKeyRequest { + // 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. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/TagKey" + } + ]; + + // Optional. Set as true to perform validations necessary for deletion, but not actually + // perform the action. + bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The etag known to the client for the expected state of the TagKey. This is + // to be used for optimistic concurrency. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Runtime operation information for deleting a TagKey. +message DeleteTagKeyMetadata { + +} diff --git a/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/proto/google/cloud/resourcemanager/v3/tag_values.proto b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/proto/google/cloud/resourcemanager/v3/tag_values.proto new file mode 100644 index 000000000000..ff4107ca6374 --- /dev/null +++ b/java-resourcemanager/proto-google-cloud-resourcemanager-v3/src/main/proto/google/cloud/resourcemanager/v3/tag_values.proto @@ -0,0 +1,295 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.resourcemanager.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ResourceManager.V3"; +option go_package = "google.golang.org/genproto/googleapis/cloud/resourcemanager/v3;resourcemanager"; +option java_multiple_files = true; +option java_outer_classname = "TagValuesProto"; +option java_package = "com.google.cloud.resourcemanager.v3"; +option php_namespace = "Google\\Cloud\\ResourceManager\\V3"; + +// Allow users to create and manage tag values. +service TagValues { + option (google.api.default_host) = "cloudresourcemanager.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only"; + + // Lists all TagValues for a specific TagKey. + rpc ListTagValues(ListTagValuesRequest) returns (ListTagValuesResponse) { + option (google.api.http) = { + get: "/v3/tagValues" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves TagValue. If the TagValue or namespaced name does not exist, or + // if the user does not have permission to view it, this method will return + // `PERMISSION_DENIED`. + rpc GetTagValue(GetTagValueRequest) returns (TagValue) { + option (google.api.http) = { + get: "/v3/{name=tagValues/*}" + }; + option (google.api.method_signature) = "name"; + } + + // 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 300 + // TagValues can exist under a TagKey at any given time. + rpc CreateTagValue(CreateTagValueRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/tagValues" + body: "tag_value" + }; + option (google.api.method_signature) = "tag_value"; + option (google.longrunning.operation_info) = { + response_type: "TagValue" + metadata_type: "CreateTagValueMetadata" + }; + } + + // Updates the attributes of the TagValue resource. + rpc UpdateTagValue(UpdateTagValueRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v3/{tag_value.name=tagValues/*}" + body: "tag_value" + }; + option (google.api.method_signature) = "tag_value,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "TagValue" + metadata_type: "UpdateTagValueMetadata" + }; + } + + // Deletes a TagValue. The TagValue cannot have any bindings when it is + // deleted. + rpc DeleteTagValue(DeleteTagValueRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v3/{name=tagValues/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "TagValue" + metadata_type: "DeleteTagValueMetadata" + }; + } + + // 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. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v3/{resource=tagValues/*}:getIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource"; + } + + // 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. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v3/{resource=tagValues/*}:setIamPolicy" + body: "*" + }; + option (google.api.method_signature) = "resource,policy"; + } + + // 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. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v3/{resource=tagValues/*}:testIamPermissions" + body: "*" + }; + option (google.api.method_signature) = "resource,permissions"; + } +} + +// A TagValue is a child of a particular TagKey. This is used to group +// cloud resources for the purpose of controlling them using policies. +message TagValue { + option (google.api.resource) = { + type: "cloudresourcemanager.googleapis.com/TagValue" + pattern: "tagValues/{tag_value}" + style: DECLARATIVE_FRIENDLY + }; + + // Immutable. Resource name for TagValue in the format `tagValues/456`. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The resource name of the new TagValue's parent TagKey. + // Must be of the form `tagKeys/{tag_key_id}`. + string parent = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // 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. + string short_name = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Namespaced name of the TagValue. Must be in the format + // `{organization_id}/{tag_key_short_name}/{short_name}`. + string namespaced_name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. User-assigned description of the TagValue. + // Must not exceed 256 characters. + // + // Read-write. + string description = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Creation time. + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time. + google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Entity tag which users can pass to prevent race conditions. This field is + // always set in server responses. See UpdateTagValueRequest for details. + string etag = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request message for listing TagValues for the specified TagKey. +message ListTagValuesRequest { + // Required. Resource name for TagKey, parent of the TagValues to be listed, + // in the format `tagKeys/123`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "*" + } + ]; + + // 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. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A pagination token returned from a previous call to `ListTagValues` + // that indicates where this listing should continue from. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The ListTagValues response. +message ListTagValuesResponse { + // A possibly paginated list of TagValues that are direct descendants of + // the specified parent TagKey. + repeated TagValue tag_values = 1; + + // 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. + string next_page_token = 2; +} + +// The request message for getting a TagValue. +message GetTagValueRequest { + // Required. Resource name for TagValue to be fetched in the format `tagValues/456`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/TagValue" + } + ]; +} + +// The request message for creating a TagValue. +message CreateTagValueRequest { + // Required. The TagValue to be created. Only fields `short_name`, `description`, + // and `parent` are considered during the creation request. + TagValue tag_value = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Set as true to perform the validations necessary for creating the resource, + // but not actually perform the action. + bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Runtime operation information for creating a TagValue. +message CreateTagValueMetadata { + +} + +// The request message for updating a TagValue. +message UpdateTagValueRequest { + // 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, + // `FAILED_PRECONDITION` will be returned. + TagValue tag_value = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Fields to be updated. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. True to perform validations necessary for updating the resource, but not + // actually perform the action. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Runtime operation information for updating a TagValue. +message UpdateTagValueMetadata { + +} + +// The request message for deleting a TagValue. +message DeleteTagValueRequest { + // Required. Resource name for TagValue to be deleted in the format tagValues/456. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/TagValue" + } + ]; + + // Optional. Set as true to perform the validations necessary for deletion, but not + // actually perform the action. + bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The etag known to the client for the expected state of the TagValue. This + // is to be used for optimistic concurrency. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Runtime operation information for deleting a TagValue. +message DeleteTagValueMetadata { + +} diff --git a/java-resourcemanager/versions.txt b/java-resourcemanager/versions.txt index 2c3351c983e6..11492c67ff53 100644 --- a/java-resourcemanager/versions.txt +++ b/java-resourcemanager/versions.txt @@ -2,3 +2,5 @@ # module:released-version:current-version google-cloud-resourcemanager:0.118.12-alpha:0.118.13-alpha-SNAPSHOT +grpc-google-cloud-resourcemanager-v3:0.118.12-alpha:0.118.13-alpha-SNAPSHOT +proto-google-cloud-resourcemanager-v3:0.118.12-alpha:0.118.13-alpha-SNAPSHOT